How can I get the path of a JarEnrty?

Alessandro A. Garbagnati

java.util.jar.JarEntry is a subclass of If you use the getName() method on your JarEntry object, you will get the full name of the entry, including its path (relative or absolute depending on how it was created). If the entru is a directory, the isDirectory() method will return true.

Try this piece of code:

JarFile file = new JarFile(<path of a jar file>);
for (Enumeration enum=file.entries(); enum.hasMoreElements();) {
  JarEntry entry = (JarEntry)enum.nextElement();
  System.out.println("Name = " + entry.getName());
  System.out.println("is directory = " + entry.isDirectory());
Remember to add some try/catch blocks... ;-)