aspose file tools
The moose likes Beginning Java and the fly likes How well to list the content of a directory in java? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "How well to list the content of a directory in java?" Watch "How well to list the content of a directory in java?" New topic
Author

How well to list the content of a directory in java?

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
How well to list the content of a directory in java?
Jon Strayer
Ranch Hand

Joined: Dec 04, 2002
Posts: 133
See java.io.File


Jon
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1865
hi Sergio,
also, beware of "Symbolic" links in the directory you are listing, to which you might not have access for listing, if you are on Unix. because if you are listing directories recursively (if you know what i mean) then that will give you error when you run the code and try to list directory that is a symbolic link to which your account doesn't have proper access rights. this might happen even if you are not using recursive approach but just listing for the current directory or something ...
there is no method, atleast i didn't find, in API that directly tells us if something is symbolic link or not..i had to write my own method for it...thats not difficult though...
regards
maulin


1. Have fun @ http://faq.javaranch.com/java/JavaRaq
2. Looking for simple infix2postfix conversion and postfix evaluation package? Click here
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How well to list the content of a directory in java?
 
Similar Threads
-classpath switch
creating a script
Recursive Read of Files from a Directory.
list the files or subdirectories ina directory
compiled or not compiled