Skip to main content

File

Complete API reference for File, including constructors, attributes, virtual attributes, and methods.

Package: JAVARuntime

Category: Files

Component: no


public class File extends File

Constructors

SignatureDescription
File(String, boolean)Creates a new instance of File.
File(File, boolean)Executes File and returns after the underlying engine call finishes.
File(File, String, boolean)Executes File and returns after the underlying engine call finishes.
File(String)Creates a new instance of File.
File(File)Executes File and returns after the underlying engine call finishes.
File(String, String)Creates a new instance of File.
File(File, String)Executes File and returns after the underlying engine call finishes.
File(URI)Creates a new instance of File.

Methods

SignatureReturnsDescription
getName()StringReturns the current name.
getParent()StringReturns the current parent.
getParentFile()FileReturns the current parent file.
getPath()StringReturns the current path.
isAbsolute()booleanReturns whether absolute is true.
getAbsolutePath()StringReturns the current absolute path.
getAbsoluteFile()FileReturns the current absolute file.
getCanonicalPath()StringExecutes getCanonicalPath and returns after the underlying engine call finishes.
getCanonicalFile()FileExecutes getCanonicalFile and returns after the underlying engine call finishes.
toURL()URLExecutes toURL and returns after the underlying engine call finishes.
toURI()URIExecutes toURI and returns after the underlying engine call finishes.
canRead()booleanReturns whether read is true.
canWrite()booleanReturns whether write is true.
exists()booleanExecutes exists and returns after the underlying engine call finishes.
isDirectory()booleanReturns whether directory is true.
isFile()booleanReturns whether file is true.
isHidden()booleanReturns whether hidden is true.
lastModified()longExecutes lastModified and returns after the underlying engine call finishes.
length()longExecutes length and returns after the underlying engine call finishes.
createNewFile()booleanExecutes createNewFile and returns after the underlying engine call finishes.
delete()booleanRemoves an item from the collection.
deleteOnExit()voidRemoves on exit from the collection.
list()String[]Executes list and returns after the underlying engine call finishes.
list(FilenameFilter)String[]Performs the list operation using the provided parameters (filter).
listFiles()File[]Executes listFiles and returns after the underlying engine call finishes.
listFiles(FilenameFilter)File[]Performs the listFiles operation using the provided parameters (filter).
listFiles(FileFilter)File[]Performs the listFiles operation using the provided parameters (filter).
mkdir()booleanExecutes mkdir and returns after the underlying engine call finishes.
mkdirs()booleanExecutes mkdirs and returns after the underlying engine call finishes.
renameTo(File)booleanPerforms the renameTo operation using the provided parameters (dest).
setLastModified(long)booleanSets or updates the last modified.
setReadOnly()booleanSets or updates the read only.
setWritable(boolean, boolean)booleanSets or updates the writable.
setWritable(boolean)booleanSets or updates the writable.
setReadable(boolean, boolean)booleanSets or updates the readable.
setReadable(boolean)booleanSets or updates the readable.
setExecutable(boolean, boolean)booleanSets or updates the executable.
setExecutable(boolean)booleanSets or updates the executable.
canExecute()booleanReturns whether execute is true.
getTotalSpace()longReturns the current total space.
getFreeSpace()longReturns the current free space.
getUsableSpace()longReturns the current usable space.
compareTo(File)intCompares this instance with another for equality/order.
equals(Object)booleanCompares this instance with another for equality/order.
hashCode()intReturns whether code is true.
toPath()PathExecutes toPath and returns after the underlying engine call finishes.
isAccessible()booleanReturns whether accessible is true.
isAccessible(String)booleanReturns whether accessible is true.

Static Methods

SignatureReturnsDescription
createTempFile(String, String, File)FileExecutes createTempFile and returns after the underlying engine call finishes.
createTempFile(String, String)FileExecutes createTempFile and returns after the underlying engine call finishes.