Chapter 8: IO Flashcards
File method, Returns true if the file or directory exists.
File.exists()
File method, Returns the name of the file or directory denoted by this path.
File.getName()
File method, Returns the absolute pathname string of this path.
File.getAbsolutePath()
File method, Returns true if the file denoted by this path is a directory.
File.isDirectory()
File method, Returns true if the file denoted by this path is a file.
File.isFile()
File method, Returns the number of bytes in the file. For performance reasons, the file system may allocate more bytes on disk than the file actually uses.
File.length()
File method, Returns the number of milliseconds since the epoch when the file was last modified.
File.lastModified()
File method, Deletes the file or directory. If this pathname denotes a directory, then the directory must be empty in order to be deleted.
File.delete()
File method, Renames the file denoted by this path.
File.renameTo(File)
File method, Creates the directory named by this path.
File.mkdir()
File method, Creates the directory named by this path including any nonexistent parent directories.
File.mkdirs()
File method, Returns the abstract pathname of this abstract pathname’s parent or null if this pathname does not name a parent directory.
File.getParent()
File method, Returns a File[] array denoting the files in the directory.
File.listFiles()
Abstract Class for reading/writing files in characters
Reader/Writer
Abstract class for reading/writing files in bytes
InputStream/OutputStream