1 package uk.ac.vamsas.test.simpleclient;
\r
4 import java.util.jar.JarFile;
\r
6 * really simple test to see if we can open an archive and test for the existence of
\r
7 * an entry called vamssDocument.xml.
\r
9 * 'Pathological' archives fail this test (due to things like funny characters or lots of '.' in the entry name.
\r
14 public class ZipTest {
\r
17 * @param args single filename as an argument to open as a Jar file.
\r
19 public static void main(String[] args) {
\r
20 File av = new File(args[0]);
\r
22 JarFile jf = new JarFile(av, false, JarFile.OPEN_READ);
\r
23 if (jf.getEntry("vamsasDocument.xml")!=null)
\r
25 System.out.println("Valid archive "+av);
\r
28 } catch (Exception f)
\r
30 System.out.println("Couldn't access jar archive "+av);
\r
31 f.printStackTrace(System.out);
\r