This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Reading directory structure... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Reading directory structure..." Watch "Reading directory structure..." New topic
Author

Reading directory structure...

Daniel Prene
Ranch Hand

Joined: Jul 15, 2005
Posts: 241
I was wondering if there was a way to retreive directory structure information from within a java application?

Thank you for your time,
-D.P.

Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Yes. In java.io.File you can get a list of the files in a directory. There are also methods to tell you whether it is a file or directory.
Daniel Prene
Ranch Hand

Joined: Jul 15, 2005
Posts: 241
Thank you for the information!
 
 
subject: Reading directory structure...