FilePathDisk
This file system stores files on disk. This is the most common file system.
Methods
static String
expandUserHomeDirectory
(String fileName)
Expand '~' to the user home directory.
static String
expandUserHomeDirectory
(String fileName)
Expand '~' to the user home directory. It is only be expanded if the '~' stands alone, or is followed by '/' or '\'.
Parameters:
fileName - the file name
Returns:
the native file name
static void
freeMemoryAndFinalize
()
Call the garbage collection and run finalization.
static void
freeMemoryAndFinalize
()
Call the garbage collection and run finalization. This close all files that were not closed, and are no longer referenced.
static String
translateFileName
(String fileName)
Translate the file name to the native format.
static String
translateFileName
(String fileName)
Translate the file name to the native format. This will replace '\' with '/' and expand the home directory ('~').
Parameters:
fileName - the file name
Returns:
the native file name
boolean
canWrite
()
boolean
canWrite
()
void
createDirectory
()
void
createDirectory
()
boolean
createFile
()
boolean
createFile
()
FilePath
createTempFile
(String suffix, boolean deleteOnExit, boolean inTempDir)
FilePath
createTempFile
(String suffix, boolean deleteOnExit, boolean inTempDir) throws IOException
void
delete
()
void
delete
()
boolean
exists
()
boolean
exists
()
FilePath
getParent
()
FilePath
getParent
()
FilePathDisk
getPath
(String path)
FilePathDisk
getPath
(String path)
String
getScheme
()
String
getScheme
()
boolean
isAbsolute
()
boolean
isAbsolute
()
boolean
isDirectory
()
boolean
isDirectory
()
long
lastModified
()
long
lastModified
()
void
moveTo
(FilePath newName, boolean atomicReplace)
void
moveTo
(FilePath newName, boolean atomicReplace)
List
newDirectoryStream
()
List
newDirectoryStream
()
InputStream
newInputStream
()
InputStream
newInputStream
() throws IOException
OutputStream
newOutputStream
(boolean append)
OutputStream
newOutputStream
(boolean append) throws IOException
FileChannel
open
(String mode)
FileChannel
open
(String mode) throws IOException
boolean
setReadOnly
()
boolean
setReadOnly
()
long
size
()
long
size
()
FilePathDisk
toRealPath
()
FilePathDisk
toRealPath
()