public class FilePathRec extends FilePathWrapper
| 构造器和说明 |
|---|
FilePathRec() |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
String |
getScheme()
Get the prefix for this file system.
|
boolean |
isTrace() |
void |
moveTo(FilePath newPath,
boolean atomicReplace)
Rename a file if this is allowed.
|
OutputStream |
newOutputStream(boolean append)
Create an output stream to write into the file.
|
FileChannel |
open(String mode)
Open a random access file object.
|
static void |
register()
Register the file system.
|
static void |
setRecorder(Recorder recorder)
Set the recorder class.
|
void |
setTrace(boolean trace) |
canWrite, createDirectory, exists, getBase, getParent, getPath, getPrefix, isAbsolute, isDirectory, lastModified, newDirectoryStream, newInputStream, setReadOnly, size, toRealPath, unwrap, unwrap, wrapget, getName, getNextTempFileNamePart, register, toString, unregisterpublic static void register()
public static void setRecorder(Recorder recorder)
recorder - the recorderpublic boolean createFile()
FilePathcreateFile 在类中 FilePathWrapperpublic FilePath createTempFile(String suffix, boolean deleteOnExit, boolean inTempDir) throws IOException
FilePathcreateTempFile 在类中 FilePathWrappersuffix - the suffixdeleteOnExit - if the file should be deleted when the virtual
machine existsinTempDir - if the file should be stored in the temporary directoryIOExceptionpublic void delete()
FilePathdelete 在类中 FilePathWrapperpublic FileChannel open(String mode) throws IOException
FilePathopen 在类中 FilePathWrappermode - the access mode. Supported are r, rw, rws, rwdIOExceptionpublic OutputStream newOutputStream(boolean append) throws IOException
FilePathnewOutputStream 在类中 FilePathWrapperappend - if true, the file will grow, if false, the file will be
truncated firstIOExceptionpublic void moveTo(FilePath newPath, boolean atomicReplace)
FilePathmoveTo 在类中 FilePathWrappernewPath - the new fully qualified file nameatomicReplace - whether the move should be atomic, and the target
file should be replaced if it exists and replacing is possiblepublic boolean isTrace()
public void setTrace(boolean trace)
Copyright © 2017. All rights reserved.