From bf865287f3d45437d68e26a76018f18d452ff4ec Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 30 Sep 2011 13:39:00 +0000 Subject: [PATCH] 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 --- .../apache/archiva/DownloadArtifactsTest.java | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) 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