aspose file tools
The moose likes Beginning Java and the fly likes how to get files with a specific path for a jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "how to get files with a specific path for a jar file" Watch "how to get files with a specific path for a jar file" New topic
Author

how to get files with a specific path for a jar file

Howie Jiang
Greenhorn

Joined: Aug 25, 2003
Posts: 26
hi,

I want to process a jar file in a java program.

I use JarFile jf = new JarFile("abc.jar");

Then in order to find all the files with path "com/def/". How to do it?

Currently what I do is very tedious especially when the jar is big.
Enumeration en = jf.entries();
then process each element in enumeration and see whether it's belong to the path.

Is there any easier way that I can list all the files with same path?
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 681
Not yet. The only way I know is how you're doing it.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to get files with a specific path for a jar file
 
Similar Threads
Reading images from a JAR file on build path
Read contents of jar file given specific path
How to extract jar files into a folder using java code?
jar file information
How to fetch information from a JAR file