File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes getting files in a directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "getting files in a directory" Watch "getting files in a directory" New topic

getting files in a directory

Phil Chuang
Ranch Hand

Joined: Feb 15, 2003
Posts: 251
How would I get all the files in a directory? Equivalent to doing a dir *.* ... ?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Look into list method. You may want to write a to select the files you want out of the directory.
Let us know if those are enough clues to go on, or if you'd like some samples.

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Phil Chuang
Ranch Hand

Joined: Feb 15, 2003
Posts: 251
Yah I found it, I was looking for the wrong type of object at first, then I peeked in the File definition and found everything I needed
I agree. Here's the link:
subject: getting files in a directory
It's not a secret anymore!