Hidden File Check In Java Example
Chapter:
Java I/O
Last Updated:
20-06-2016 18:40:08 UTC
Program:
/* ............... START ............... */
import java.io.File;
import java.io.IOException;
public class JavaHiddenFileCheckExample {
public static void main(String[] args) throws IOException, SecurityException {
File file = new File("c:/myfile.txt");
if (file.isHidden()) {
System.out.println("The specified file is hidden");
} else {
System.out.println("The specified file is not hidden");
}
}
}
/* ............... END ............... */
Notes:
-
Java isHidden() method of File class to perform this check. This method returns a boolean value (true or false), if file is hidden then this method returns true otherwise it returns a false value.
Tags
Hidden File Check, Java,I/O