public abstract class FilePathWrapper extends FilePath
| 构造器和说明 |
|---|
FilePathWrapper() |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
FilePath |
createTempFile(String suffix,
boolean deleteOnExit,
boolean inTempDir)
Create a new temporary file.
|
void |
delete()
Delete a file or directory if it exists.
|
boolean |
exists()
Checks if a file exists.
|
protected FilePath |
getBase() |
FilePath |
getParent()
Get the parent directory of a file or directory.
|
FilePathWrapper |
getPath(String path)
Convert a file to a path.
|
protected String |
getPrefix() |
boolean |
isAbsolute()
Check if the file name includes a path.
|
boolean |
isDirectory()
Check if it is a file or a directory.
|
long |
lastModified()
Get the last modified date of a file
|
void |
moveTo(FilePath newName,
boolean atomicReplace)
Rename a file if this is allowed.
|
List<FilePath> |
newDirectoryStream()
List the files and directories in the given directory.
|
InputStream |
newInputStream()
Create an input stream to read from the file.
|
OutputStream |
newOutputStream(boolean append)
Create an output stream to write into the file.
|
FileChannel |
open(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
|
FilePath |
toRealPath()
Normalize a file name.
|
FilePath |
unwrap()
Get the unwrapped file name (without wrapper prefixes if wrapping /
delegating file systems are used).
|
protected FilePath |
unwrap(String path)
Get the base path for the given wrapped path.
|
FilePathWrapper |
wrap(FilePath base)
Create a wrapped path instance for the given base path.
|
get, getName, getNextTempFileNamePart, getScheme, register, toString, unregisterpublic FilePathWrapper getPath(String path)
FilePathjava.nio.file.spi.FileSystemProvider.getPath, but may
return an object even if the scheme doesn't match in case of the the
default file provider.public FilePathWrapper wrap(FilePath base)
base - the base pathpublic FilePath unwrap()
FilePathprotected String getPrefix()
protected FilePath unwrap(String path)
path - the path including the scheme prefixprotected FilePath getBase()
public boolean canWrite()
FilePathpublic void createDirectory()
FilePathcreateDirectory 在类中 FilePathpublic boolean createFile()
FilePathcreateFile 在类中 FilePathpublic void delete()
FilePathpublic boolean exists()
FilePathpublic FilePath getParent()
FilePathpublic boolean isAbsolute()
FilePathisAbsolute 在类中 FilePathpublic boolean isDirectory()
FilePathisDirectory 在类中 FilePathpublic long lastModified()
FilePathlastModified 在类中 FilePathpublic FilePath toRealPath()
FilePathtoRealPath 在类中 FilePathpublic List<FilePath> newDirectoryStream()
FilePathnewDirectoryStream 在类中 FilePathpublic void moveTo(FilePath newName, boolean atomicReplace)
FilePathpublic InputStream newInputStream() throws IOException
FilePathnewInputStream 在类中 FilePathIOExceptionpublic OutputStream newOutputStream(boolean append) throws IOException
FilePathnewOutputStream 在类中 FilePathappend - if true, the file will grow, if false, the file will be
truncated firstIOExceptionpublic FileChannel open(String mode) throws IOException
FilePathopen 在类中 FilePathmode - the access mode. Supported are r, rw, rws, rwdIOExceptionpublic boolean setReadOnly()
FilePathsetReadOnly 在类中 FilePathpublic long size()
FilePathpublic FilePath createTempFile(String suffix, boolean deleteOnExit, boolean inTempDir) throws IOException
FilePathcreateTempFile 在类中 FilePathsuffix - the suffixdeleteOnExit - if the file should be deleted when the virtual
machine existsinTempDir - if the file should be stored in the temporary directoryIOExceptionCopyright © 2017. All rights reserved.