This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Reading dir" Watch "Reading dir" New topic

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

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

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
Consider Paul's rocket mass heater.
subject: Reading dir
It's not a secret anymore!