This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "getting files in a directory" Watch "getting files in a directory" New topic
Author

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 java.io.File list method. You may want to write a java.io.FilenameFilter 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: http://aspose.com/file-tools
 
subject: getting files in a directory
 
Similar Threads
Dreamweaver pop up menu behavior
Tomcat installation
reading files in specific directory
Help!!!!!
Using j2ee packages