Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading directory structure...

 
Daniel Prene
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the information!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic