How do I check if a file is hidden?

Bookmark this example!  
Category: java.io, viewed: 1404 time(s).
 
package org.kodejava.sample.java.io;
 
import java.io.File;
import java.io.IOException;
 
public class FileHiddenExample
{
    public static void main(String[] args) throws IOException
    {
        File file = new File("Hidden.txt");
        file.createNewFile();
 
        // We are using the isHidden() method to check whether file
        // specified file is hidden.
        if (file.isHidden())
        {
            System.out.println("File is hidden!");
        } else
        {
            System.out.println("File is not hidden!");
        }
    }
}
 
 
Can't find what you are looking for? Join our FORUMS and ask some questions!
Firefox 2
Google

100 Top & Latest

GetJava Download Button

Locations of visitors to this page
eXTReMe Tracker
visitor stats