From: Olivier Lamy Date: Fri, 30 Sep 2011 13:39:00 +0000 (+0000) Subject: don't fail on bad zip file to get debug infos X-Git-Tag: archiva-1.4-M1~152 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bf865287f3d45437d68e26a76018f18d452ff4ec;p=archiva.git don't fail on bad zip file to get debug infos git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1177659 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java index cdb26b39e..893cffbc2 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java @@ -62,6 +62,7 @@ import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; +import java.util.Collections; import java.util.Enumeration; import java.util.List; import java.util.zip.ZipEntry; @@ -244,13 +245,21 @@ public class DownloadArtifactsTest private List getZipEntriesNames( ZipFile zipFile ) { - List entriesNames = new ArrayList(); - Enumeration entries = zipFile.entries(); - while ( entries.hasMoreElements() ) + try { - entriesNames.add( entries.nextElement().getName() ); + List entriesNames = new ArrayList(); + Enumeration entries = zipFile.entries(); + while ( entries.hasMoreElements() ) + { + entriesNames.add( entries.nextElement().getName() ); + } + return entriesNames; } - return entriesNames; + catch ( Throwable e ) + { + log.info( "fail to get zipEntries " + e.getMessage(), e ); + } + return Collections.emptyList(); } public static class RedirectServlet