Check hidden file java
In below sample you will see how to check if file is hidden using java program:
- CheckHiddenFileJava.java
package com.javahonk; import java.io.File; public class CheckHiddenFileJava { public static void main(String[] args) { File file = new File("C:\\SYSTEM.SAV"); if (file.exists()) { System.out.println("File hidden: "+file.isHidden()); }else { System.out.println("File does not exits"); } } }
- Output:
- For more information about file api please refer oracle tutorial here