boolean java.io.File.isHidden()
Tests whether the file named by this abstract pathname is a hidden file. The exact definition of hidden is system-dependent. On UNIX systems, a file is considered to be hidden if its name begins with a period character ('.'). On Microsoft Windows systems, a file is considered to be hidden if it has been marked as such in the filesystem.
Returns:
true if and only if the file denoted by this abstract pathname is hidden according to the conventions of the underlying platform
Throws:
SecurityException - If a security manager exists and its java.lang.SecurityManager.checkRead(java.lang.String) method denies read access to the file
Since:
1.2
HiddenFile.java
Tests whether the file named by this abstract pathname is a hidden file. The exact definition of hidden is system-dependent. On UNIX systems, a file is considered to be hidden if its name begins with a period character ('.'). On Microsoft Windows systems, a file is considered to be hidden if it has been marked as such in the filesystem.
Returns:
true if and only if the file denoted by this abstract pathname is hidden according to the conventions of the underlying platform
Throws:
SecurityException - If a security manager exists and its java.lang.SecurityManager.checkRead(java.lang.String) method denies read access to the file
Since:
1.2
HiddenFile.java
package com.javatutorialcorner.directory;
import java.io.File;
public class HiddenFile {
public static void main(String[] args) {
File file = new File("C:/JTC/Java/Examples/Directory/File/java.txt");
System.out.println("Is Hidden : "+file.isHidden());
}
}
Output
Is Hidden : false




0 comments:
Post a Comment