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

Similar Programs Chapter Last Updated
FileWriter In Java Example Java I/O 21-07-2016
FileReader In Java Example Java I/O 21-07-2016
FileOutputStream In Java Example Java I/O 21-07-2016
FileInputStream In Java Example Java I/O 21-07-2016
DataOutputStream In Java Example Java I/O 21-07-2016
DataInputStream In Java Example Java I/O 21-07-2016
CharArrayWriter In Java Example Java I/O 13-04-2016
CharArrayReader In Java Example Java I/O 21-07-2016
ByteArrayOutputStream In Java Example Java I/O 21-07-2016
ByteArrayInputStream In Java Example Java I/O 21-07-2016
BufferedWriter In Java Example Java I/O 21-07-2016
BufferedReader In Java Example Java I/O 21-07-2016
BufferedOutputStream In Java Example Java I/O 21-07-2016
BufferedInputStream In Java Example Java I/O 21-07-2016
ProcessBuilder To Make System Calls In Java Java I/O 19-08-2017

1