/* Author : Michael Robinson Program : filesFile.java Purpose : Checks the status of a file Updated : Dec 15, 2099 */ import java.io.*; public class filesFile { public static void processFile() throws IOException { //creates the object myFile of the File class File myFile = new File( "1200.dna" ); //displays the name of the myFile object System.out.print( myFile.getName() ); if( !myFile.exists() ) { System.out.println( " Does NOT exist" + "\n" ); } else { System.out.println( " exists\n" ); System.out.println( "canExecute() = " + myFile.canExecute() ); System.out.println( "canRead() = " + myFile.canRead() ); System.out.println( "canWrite() = " + myFile.canWrite() ); System.out.println( "createNewFile() = " + myFile.createNewFile() ); //if you remove the // in the next two lines //the 1200.dna file will be removed //System.out.println( "delete() = " + // myFile.delete() ); System.out.println( "exists() = " + myFile.exists() ); System.out.println( "getClass() = " + myFile.getClass() ); System.out.println( "getFreeSpace() = " + myFile.getFreeSpace() ); System.out.println( "getName() = " + myFile.getName() ); System.out.println( "getParent() = " + myFile.getParent() ); System.out.println( "getParentFile() = " + myFile.getParentFile() ); System.out.println( "getPath() = " + myFile.getPath() ); System.out.println( "getTotalSpace() = " + myFile.getTotalSpace() ); System.out.println( "getAbsoluteFile() = " + myFile.getAbsoluteFile() ); System.out.println( "getAbsolutePath() = " + myFile.getAbsolutePath() ); } }//end public static void processFile() public static void main( String arg[] ) throws IOException { processFile(); }//end public static void main( String arg[] ) }//end public class filesFile