Package | Description |
---|---|
java.io | |
java.lang |
Provides classes that are fundamental to the design of the Java
programming language.
|
Modifier and Type | Method and Description |
---|---|
static File |
File.createTempFile(String prefix,
String suffix)
Creates an empty file in the default temporary-file directory, using
the given prefix and suffix to generate its name.
|
static File |
File.createTempFile(String prefix,
String suffix,
File directory)
Creates a new empty file in the specified directory, using the
given prefix and suffix strings to generate its name.
|
File |
File.getAbsoluteFile()
Returns the absolute form of this abstract pathname.
|
File |
File.getCanonicalFile()
Returns the canonical form of this abstract pathname.
|
File |
File.getParentFile()
Returns the abstract pathname of this abstract pathname's parent,
or
null if this pathname does not name a parent
directory. |
File[] |
File.listFiles()
Returns an array of abstract pathnames denoting the files in the
directory denoted by this abstract pathname.
|
File[] |
File.listFiles(FileFilter filter)
Returns an array of abstract pathnames denoting the files and
directories in the directory denoted by this abstract pathname that
satisfy the specified filter.
|
File[] |
File.listFiles(FilenameFilter filter)
Returns an array of abstract pathnames denoting the files and
directories in the directory denoted by this abstract pathname that
satisfy the specified filter.
|
static File[] |
File.listRoots()
List the available filesystem roots.
|
Modifier and Type | Method and Description |
---|---|
boolean |
FileFilter.accept(File pathname)
Tests whether or not the specified abstract pathname should be
included in a pathname list.
|
boolean |
FilenameFilter.accept(File dir,
String name)
Tests if a specified file should be included in a file list.
|
int |
File.compareTo(File pathname)
Compares two abstract pathnames lexicographically.
|
static File |
File.createTempFile(String prefix,
String suffix,
File directory)
Creates a new empty file in the specified directory, using the
given prefix and suffix strings to generate its name.
|
boolean |
File.renameTo(File dest)
Renames the file denoted by this abstract pathname.
|
Constructor and Description |
---|
File(File parent,
String child)
Creates a new
File instance from a parent abstract
pathname and a child pathname string. |
FileInputStream(File file)
Creates a
FileInputStream by
opening a connection to an actual file,
the file named by the File
object file in the file system. |
FileOutputStream(File file)
Creates a file output stream to write to the file represented by
the specified
File object. |
FileOutputStream(File file,
boolean append)
Creates a file output stream to write to the file represented by
the specified
File object. |
FileReader(File file)
Creates a new FileReader, given the File
to read from.
|
FileWriter(File file)
Constructs a FileWriter object given a File object.
|
FileWriter(File file,
boolean append)
Constructs a FileWriter object given a File object.
|
PrintStream(File file)
Creates a new print stream, without automatic line flushing, with the
specified file.
|
PrintStream(File file,
String csn)
Creates a new print stream, without automatic line flushing, with the
specified file and charset.
|
PrintWriter(File file)
Creates a new PrintWriter, without automatic line flushing, with the
specified file.
|
PrintWriter(File file,
String csn)
Creates a new PrintWriter, without automatic line flushing, with the
specified file and charset.
|
RandomAccessFile(File file,
String mode)
Creates a random access file stream to read from, and optionally to
write to, the file specified by the
File argument. |
Modifier and Type | Method and Description |
---|---|
File |
ProcessBuilder.directory()
Returns this process builder's working directory.
|
File |
ProcessBuilder.Redirect.file()
Returns the
File source or destination associated
with this redirect, or null if there is no such file. |
Modifier and Type | Method and Description |
---|---|
static ProcessBuilder.Redirect |
ProcessBuilder.Redirect.appendTo(File file)
Returns a redirect to append to the specified file.
|
ProcessBuilder |
ProcessBuilder.directory(File directory)
Sets this process builder's working directory.
|
Process |
Runtime.exec(String[] cmdarray,
String[] envp,
File dir)
Executes the specified command and arguments in a separate process with
the specified environment and working directory.
|
Process |
Runtime.exec(String command,
String[] envp,
File dir)
Executes the specified string command in a separate process with the
specified environment and working directory.
|
static ProcessBuilder.Redirect |
ProcessBuilder.Redirect.from(File file)
Returns a redirect to read from the specified file.
|
ProcessBuilder |
ProcessBuilder.redirectError(File file)
Sets this process builder's standard error destination to a file.
|
ProcessBuilder |
ProcessBuilder.redirectInput(File file)
Sets this process builder's standard input source to a file.
|
ProcessBuilder |
ProcessBuilder.redirectOutput(File file)
Sets this process builder's standard output destination to a file.
|
static ProcessBuilder.Redirect |
ProcessBuilder.Redirect.to(File file)
Returns a redirect to write to the specified file.
|