File IsHidden() Example
Tests whether the file named by this abstract pathname is a hidden file.
File class IsHidden() method example. This example shows you how to use IsHidden method.This method Tests whether the file named by this abstract pathname is a hidden file.
Here is the code:-
/**
* @Program that Tests whether the file named by this abstract pathname is
* a hidden file.
* IsHidden.java
* Author:-RoseIndia Team
* Date:-30-May-2008
*/
import java.io.*;
public class IsHidden {
public static void main(String[] args) {
File f = new File("/home/girish/Desktop/g.txt");
if (f.exists()) {
boolean b = f.isHidden();
System.out.println("is a hidden file : " + b);
} else {
System.out.println("File does not exists");
}
}
} |
|