• Post Reply Bookmark Topic Watch Topic
  • New Topic

check if File is hidden or system file  RSS feed

 
Yahya Elyasse
Ranch Hand
Posts: 510
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Let me explain my concern:

I'm filling a JTree with user system files/folders and I'm using the File class for this purpose.
I noticed the JTree displays also hidden & system files which will confuse the user of my application.
I first thought to use some File method & isHidden() was first candidate.I first tried



but that's not working ..i tried



which seems to do better but I'm still incapable of solving this issue.
I thought using Runtime.exec() but don't know what commands to use to check system & hidden files (this should take in consideration the OS win or Mac).

can some one suggest me a good and simple solution for this problem ?
thanks.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!