aspose file tools*
The moose likes Java in General and the fly likes Reading dir Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Reading dir" Watch "Reading dir" New topic
Author

Reading dir

Manuel Paco
Ranch Hand

Joined: Sep 23, 2001
Posts: 58
Help please
How can I get all let's say "gif" or "jpg" files residing in the directory
"C:\MyFiles" to my String array.
Mark Herschberg
Sheriff

Joined: Dec 04, 2000
Posts: 6037
Use the java.io.File's list() and related methods. If you want to get complex, use the java.io.FilenameFilter interface. In any case, you'll end up with an array of Strings.
--Mark
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Manuel Paco
Ranch Hand

Joined: Sep 23, 2001
Posts: 58
Thank you very much
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading dir