This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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: 24189

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
jQuery in Action, 3rd edition