Antriksh Verma wrote:How to find a file[any file] in whole computer system without passing path
in JAVA , Please Help out.
Antriksh Verma wrote:How to find a file[any file] in whole computer system without passing path
in JAVA , Please Help out.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
karan chandok wrote:But the problem is, it is checking only the drives but not the folders or subfolders for the file
Do you have any idea how we can do that?
2. Now write the parseAllFiles(String parentFolder) method that will parse the folder and its subfolders.
a. Get all the files of the input parent folder using File.listFiles() method
b. Check if the file is a directory using File.isDirectory() method
c. If it is a directory then call parseAllFiles() method recursively
d. Else if it is a file check the file name with the file name you are searching for.
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|