Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How well to list the content of a directory in java?
 
Jon Strayer
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See java.io.File
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic