File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Search File at all locations

 
karan chandok
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying a program that can search file in all drives

But issue is it is searching for file only in current directory

Is there any way that I can find the file at all locations?

Thanks in Advance
 
Rob Spoor
Sheriff
Pie
Posts: 20396
47
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please KeepItDown. That doesn't include all uppercase letters but also larger fonts. It's completely unnecessary.

With java.io.File you can first use the static listRoots() methods to list all of the root files. You must then use a recursive method that for those. In pseudo code:
With java.nio.file.Path it's a bit different, because you can use FileVisitor:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic