Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Access files in folders and sub-folders

 
Mutua Kakinyi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to write a midlet code that lists all files in a folder and its sub-folders, if available, of a given parent folder, say root1. I imagine I need a code that does a recursive traversal of folders and sub-folders. Can some share with me a hint (some codes maybe) on how to start.

Thank you in advance.

Mutua
 
prtk bhardwaj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hiii
use browse folder menu of netbeans ide
 
Randall Twede
Ranch Hand
Posts: 4535
6
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the book im reading right now has an example of doing just that. give me a minute and ill look it up. like you are waiting for me hehe.


as you can see it is indeed recursive.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!