wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes recursive methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "recursive methods" Watch "recursive methods" New topic

recursive methods

Ravindra Suroju

Joined: Mar 11, 2008
Posts: 14
Hi all,

I want to print the absolute path of all files (including the files in subfolders) in a given directory [C:/Source]. Please help me what is wrong with my code...

Best Regards,<br />Ravindra.
Joanne Neal

Joined: Aug 05, 2005
Posts: 3431
What makes you thing there's something wrong with it ? Does it not compile (show us the error messages) or does it not do what you expected (tell us what it does do and how this differs from what you expected).

Bob Good
Ranch Hand

Joined: Jan 09, 2008
Posts: 86
1) Class names should begin with a capital (Test not test)
2) Instance variables should be non capitalized (directory not Directory, path not Path)
2) You have provided no comments
3) directory.getDirectoryList("/" + args[0]); <== corrected
4) File tempFile = new File(path + "/" + dirContents[i]); <== corrected

You were very close.
Ravindra Suroju

Joined: Mar 11, 2008
Posts: 14
Thanks so much Bob...
Don't get me started about those stupid light bulbs.
subject: recursive methods
Similar Threads
File filter without empty directory
File Class question
why it throws NullPointerException
No more files
javac -cp legal?