File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Recursively list all files in a jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Recursively list all files in a jar" Watch "Recursively list all files in a jar" New topic
Author

Recursively list all files in a jar

Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
I have a jar with Scala source files in it and I want to list all the file names. It seems like it should be a pretty simple, but the best I could come up with is this convoluted mess. Please tell me there is a better way.



Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them. - Laurence J. Peter
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8



If I'm not mistaken, this gives you all of the entries in the JAR. You don't need to do anything recursively.
Garrett Rowe
Ranch Hand

Joined: Jan 17, 2006
Posts: 1296
Doh! You're absolutely correct Paul. I erroneously thought that since it explicitly listed the directories, it didn't list the files under the directories. Thanks for setting me straight.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Recursively list all files in a jar