public class FilePathMem extends FilePath
| Constructor and Description |
|---|
FilePathMem() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canWrite()
Check if the file is writable.
|
void |
createDirectory()
Create a directory (all required parent directories already exist).
|
boolean |
createFile()
Create a new file.
|
void |
delete()
Delete a file or directory if it exists.
|
boolean |
exists()
Checks if a file exists.
|
protected static java.lang.String |
getCanonicalPath(java.lang.String fileName)
Get the canonical path for this file name.
|
FilePathMem |
getParent()
Get the parent directory of a file or directory.
|
FilePathMem |
getPath(java.lang.String path)
Convert a file to a path.
|
java.lang.String |
getScheme()
Get the scheme (prefix) for this file provider.
|
boolean |
isAbsolute()
Check if the file name includes a path.
|
boolean |
isDirectory()
Check if it is a file or a directory.
|
boolean |
isRegularFile()
Check if it is a regular file.
|
long |
lastModified()
Get the last modified date of a file
|
void |
moveTo(FilePath newName,
boolean atomicReplace)
Rename a file if this is allowed.
|
java.util.List<FilePath> |
newDirectoryStream()
List the files and directories in the given directory.
|
java.nio.channels.FileChannel |
open(java.lang.String mode)
Open a random access file object.
|
boolean |
setReadOnly()
Disable the ability to write.
|
long |
size()
Get the size of a file in bytes
|
FilePathMem |
toRealPath()
Normalize a file name.
|
createTempFile, get, getName, newFileChannelOutputStream, newInputStream, newOutputStream, register, toString, unregister, unwrappublic FilePathMem getPath(java.lang.String path)
FilePathjava.nio.file.spi.FileSystemProvider.getPath, but may
return an object even if the scheme doesn't match in case of the
default file provider.public long size()
FilePathpublic void moveTo(FilePath newName, boolean atomicReplace)
FilePathpublic boolean createFile()
FilePathcreateFile in class FilePathpublic boolean exists()
FilePathpublic void delete()
FilePathpublic java.util.List<FilePath> newDirectoryStream()
FilePathnewDirectoryStream in class FilePathpublic boolean setReadOnly()
FilePathsetReadOnly in class FilePathpublic boolean canWrite()
FilePathpublic FilePathMem getParent()
FilePathpublic boolean isDirectory()
FilePathisDirectory in class FilePathpublic boolean isRegularFile()
FilePathisRegularFile in class FilePathpublic boolean isAbsolute()
FilePathisAbsolute in class FilePathpublic FilePathMem toRealPath()
FilePathtoRealPath in class FilePathpublic long lastModified()
FilePathlastModified in class FilePathpublic void createDirectory()
FilePathcreateDirectory in class FilePathpublic java.nio.channels.FileChannel open(java.lang.String mode)
FilePathprotected static java.lang.String getCanonicalPath(java.lang.String fileName)
fileName - the file name