Switched to using pure java Apache Zip implementation
[vamsas.git] / src / uk / ac / vamsas / test / simpleclient / ZipTest.java
index 0c6fa11..a860e0e 100644 (file)
@@ -18,6 +18,7 @@ public class ZipTest {
    */\r
   public static void main(String[] args) {\r
     File av = new File(args[0]);\r
+    boolean jfailed=false;\r
     try {\r
       JarFile jf = new JarFile(av, false, JarFile.OPEN_READ);\r
       if (jf.getEntry("vamsasDocument.xml")!=null)\r
@@ -25,6 +26,20 @@ public class ZipTest {
         System.out.println("Valid archive "+av);\r
       }\r
       jf.close();\r
+      return;\r
+    } catch (Exception f)\r
+    {\r
+      System.out.println("Couldn't access jar archive "+av);\r
+      f.printStackTrace(System.out);\r
+    }\r
+    try {\r
+      System.out.println("Trying the Apache Zip Package:");\r
+      org.apache.tools.zip.ZipFile jf = new org.apache.tools.zip.ZipFile(av);\r
+      if (jf.getEntry("vamsasDocument.xml")!=null)\r
+      {\r
+        System.out.println("Valid archive "+av);\r
+      }\r
+      jf.close();\r
     } catch (Exception f)\r
     {\r
       System.out.println("Couldn't access jar archive "+av);\r