How do I check/set for hidden files?
Created Jan 30, 2002
Alessandro A. Garbagnati Setting a file "hidden" is a system-specific operation and, often, the way to do this is completely different depending upon the platform.
As far as checking goes, just call File.isHidden() to check.
In Unix, for example, this can be done by simply renaming the file to a name that starts with the ".". As you can see, on this operating system, setting a file to hidden can be done with the renameTo() method.
On Windows, you'd have to execute a system call or use JNI to change attributes.