• Post Reply Bookmark Topic Watch Topic
  • New Topic

Directory Search  RSS feed

 
Enos Winder
Greenhorn
Posts: 18
C++ Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I am supposed to write a simple little code to search the directory. I found this example and have it to base my model on. The question I have is the File.listRoots. This is the part that searches the entire computer. I need to restrict it to only look for the file that the user asks for and the spot that the user wants to look. Here is my code

 
Tushar Goel
Ranch Hand
Posts: 934
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why don't you call listFiles(FileFilter filter) method instead of listRoots...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!