Link to home
Start Free TrialLog in
Avatar of binuts
binuts

asked on

Reding directories using JAVA

I would like to know, how to read directories and search through the files in it using JAVA. Also i want to know how to get the permissions for each files in the directory. All your comments regarding this are welcome.
Avatar of Ravindra76
Ravindra76

Hi,

See the documentation of your systems
c:\java_hone\src\java\io\File.java

It has all methods.
list() - Listing all files
isDIrectory() - Is directoy
isFile() - Isa file
canRead() - Is file readable
canWrite() - Is writable.

Best of luck
ASKER CERTIFIED SOLUTION
Avatar of Ravindra76
Ravindra76

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of binuts

ASKER

Thanks Ravindra76. It worked.