Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

get list of folders  RSS feed

 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.io.File 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.
 
aymane chetibi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!