• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting SubFolders from the Specified Folder.  RSS feed

 
Prabhakar Pentela
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have requirement that get all the subfolders(Recursivly..it will be deep up to 10 levels) under the specifed folder and put in to text file or xml. Using File object, i can go up to 2 or 3 levels..can somebody tell me the good approach to solve this problem?

Thanks,
pendyala
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced question. Moving...
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

First, a bit of business: you may not have read our naming policy on the way in. It requires that you use a full, real (sounding) first and last name for your display name. Initials aren't enough. You can change your display name here. Thanks!

Anyway: why do you think using the File object will limit the depth of the recursion? you should be able to do this using Files quite easily. If you can't -- well, if you can't, then you can't do it at all, as that's the only way that Java provides for accessing directory contents.
 
Prabhakar Pentela
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks..i got it with file object. i am going to change display name.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!