Here we pass the path of the file for which we want to test hidden property and it will return true if it’s a hidden file otherwise will get false value.
import java.io.File;
/**
*
*@author Mysterios
*
**/
public class FileHiddenExample
{
public static void main(String args[])throws SecurityException , IOException
{
File file=new File("C:/Hiddentext.txt");
if(file.isHidden())
System.out.println("this file is a hidden file");
else
System.out.println("this file is not hidden");
}
}
/**
*
*@author Mysterios
*
**/
public class FileHiddenExample
{
public static void main(String args[])throws SecurityException , IOException
{
File file=new File("C:/Hiddentext.txt");
if(file.isHidden())
System.out.println("this file is a hidden file");
else
System.out.println("this file is not hidden");
}
}
No comments:
Post a Comment