]> source.dussan.org Git - archiva.git/commitdiff
don't fail on bad zip file to get debug infos
authorOlivier Lamy <olamy@apache.org>
Fri, 30 Sep 2011 13:39:00 +0000 (13:39 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 30 Sep 2011 13:39:00 +0000 (13:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1177659 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/DownloadArtifactsTest.java

index cdb26b39eab0304dbd547cce751868245bc1c072..893cffbc20e8a16d009361616e6c3eec4f10c3b5 100644 (file)
@@ -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<String> getZipEntriesNames( ZipFile zipFile )
     {
-        List<String> entriesNames = new ArrayList<String>();
-        Enumeration<? extends ZipEntry> entries = zipFile.entries();
-        while ( entries.hasMoreElements() )
+        try
         {
-            entriesNames.add( entries.nextElement().getName() );
+            List<String> entriesNames = new ArrayList<String>();
+            Enumeration<? extends ZipEntry> 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