Anyone knows a 2-3 line solution for iterating over classes in some Jar file ?
( I have an instance of java.net.URL in my hand )
Thanks
Accessing zips and jars using Java Part 1
Accessing zips and jars using Java Part 2
Here is a code snippet from first article:
  ZipFile zip = new ZipFile(fileName);
  // Process the zip file. Close it when the block is exited.
  try {
     // Loop through the zip entries and print the name of each one.
     for (Enumeration list = zip.entries(); list.hasMoreElements(); ) {
        ZipEntry entry = (ZipEntry) list.nextElement();
        System.out.println(entry.getName());
     }
  }
  finally {
     zip.close();
  }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With