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 get list of folders Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "get list of folders " Watch "get list of folders " New topic

get list of folders

aymane chetibi
Ranch Hand

Joined: Apr 12, 2006
Posts: 175
hello all,
i have an application that gets the list of folders in a specific folder and then gets all the files within each folder.

How can I do that please.
thanks alot!
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24166

The class has a list() method and a listFiles() method, either of which can list the contents of a directory. There's also an isDirectory() method to tell you which Files are actually Directories.

[Jess in Action][AskingGoodQuestions]
aymane chetibi
Ranch Hand

Joined: Apr 12, 2006
Posts: 175
thanks a lot
I agree. Here's the link:
subject: get list of folders
Similar Threads
NoSuchMethodError in CMR
stopping a table from collapsing when clicking on image its getting reloaded
Regarding including jar files for directory
Access right on Data Folder
Folder's First in JTree