public interface FileSystem
SYSTEM
实现,它使用主机的本地文件系统 备用
实现可用于注入错误(用于测试)或转换存储的数据(用于添加)
例如加密)| Modifier and Type | Field and Description |
|---|---|
static FileSystem |
SYSTEM |
| Modifier and Type | Method and Description |
|---|---|
Sink |
appendingSink(File file) |
void |
delete(File file) |
void |
deleteContents(File directory) |
boolean |
exists(File file) |
void |
rename(File from,
File to) |
Sink |
sink(File file) |
long |
size(File file) |
Source |
source(File file) |
static final FileSystem SYSTEM
Source source(File file) throws FileNotFoundException
FileNotFoundExceptionSink sink(File file) throws FileNotFoundException
FileNotFoundExceptionSink appendingSink(File file) throws FileNotFoundException
FileNotFoundExceptionvoid delete(File file) throws IOException
IOExceptionboolean exists(File file)
long size(File file)
void rename(File from, File to) throws IOException
IOExceptionvoid deleteContents(File directory) throws IOException
IOExceptionCopyright © 2020. All rights reserved.