public interface FileObject
限定符和类型 | 方法和说明 |
---|---|
BufferedReaderObject |
bufferedReader(String path,
Charset charsets)
BufferedReader流
|
BufferedWriterObject |
bufferedWriter(String path,
boolean append,
Charset charsets)
BufferedWriter流
|
default BufferedWriterObject |
bufferedWriter(String path,
Charset charsets)
BufferedWriter流(默认覆盖文件内容)
|
boolean |
copy(String path,
String newPath)
复制文件/文件夹
|
boolean |
createDir(String path)
创建文件夹
|
boolean |
createFile(String path)
创建文件
|
boolean |
delete(String path)
删除文件/文件夹。
|
boolean |
deleteForce(String path)
强制删除文件/文件夹。
|
boolean |
isDir(String path)
是否是文件夹
|
boolean |
isExist(String path)
文件/文件夹,是否存在
|
List<String> |
list(String path)
查看文件夹下所有 文件/文件夹 名称列表
|
RandomAccessFileObject |
randomAccessFile(String path,
String mode)
返回RandomAccessFileObject
|
void |
releaseResources()
主动释放所有FileObject产生的资源
|
boolean |
sendFile(int affinity,
String path,
boolean overwrite)
指定affinity,同步发送文件。
|
Future<Boolean> |
sendFileAsync(int affinity,
String path,
boolean overwrite)
指定affinity,异步发送文件。
|
boolean isExist(String path) throws GraphDbFileIOException
path
- 文件路径GraphDbFileIOException
- IO异常boolean isDir(String path) throws GraphDbFileIOException
path
- 文件路径GraphDbFileIOException
- IO异常List<String> list(String path) throws GraphDbFileIOException
path
- 文件夹路径GraphDbFileIOException
- IO异常boolean createFile(String path) throws GraphDbFileIOException
path
- 文件路径GraphDbFileIOException
- IO异常boolean createDir(String path) throws GraphDbFileIOException
path
- 文件路径GraphDbFileIOException
- IO异常boolean delete(String path) throws GraphDbFileIOException
path
- 文件/文件夹路径GraphDbFileIOException
- IO异常boolean deleteForce(String path) throws GraphDbFileIOException
path
- 文件/文件夹路径GraphDbFileIOException
- IO异常boolean copy(String path, String newPath) throws GraphDbFileIOException
path
- 文件/文件夹路径newPath
- 需要复制到的路径GraphDbFileIOException
- IO异常boolean sendFile(int affinity, String path, boolean overwrite) throws GraphDbFileIOException
affinity
- 节点编号path
- 文件路径overwrite
- 若远端有同盟文件是否覆盖。true覆盖,false跳过GraphDbFileIOException
- IO异常Future<Boolean> sendFileAsync(int affinity, String path, boolean overwrite)
affinity
- 节点编号path
- 文件路径overwrite
- 若远端有同盟文件是否覆盖。true覆盖,false跳过BufferedReaderObject bufferedReader(String path, Charset charsets) throws GraphDbFileIOException
path
- 文件路径charsets
- 字符编码GraphDbFileIOException
- IO异常default BufferedWriterObject bufferedWriter(String path, Charset charsets) throws GraphDbFileIOException
path
- 文件路径charsets
- 字符编码GraphDbFileIOException
- IO异常BufferedWriterObject bufferedWriter(String path, boolean append, Charset charsets) throws GraphDbFileIOException
path
- 文件路径append
- 写入时追加(true)或覆盖(false)charsets
- 字符编码GraphDbFileIOException
- IO异常RandomAccessFileObject randomAccessFile(String path, String mode) throws GraphDbFileIOException
path
- 文件路径mode
- 读写模式(r:只读 rw:读、写 rws:读、写同步,刷新内容、元数据 rwd:读、写同步,刷新内容)GraphDbFileIOException
- IO异常void releaseResources() throws GraphDbFileIOException
GraphDbFileIOException
- IO异常