Constructor and Description |
---|
SynchronizedFilePool(FilePool proxy) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
清空文件池
|
File |
createDir()
在池中创建一个临时目录
|
File |
createFile(String suffix)
在池中创建一个文件
|
long |
current() |
File |
getDir(long fId)
获取一个临时目录,如果临时目录不存在,返回null
|
File |
getFile(long fId,
String suffix)
获取一个文件,如果文件不存在,返回null
|
long |
getFileId(File f)
获取一个文件在池中的 ID。 如果这个文件不在池中,返回 -1
|
boolean |
hasDir(long fId)
判断文件池中是否存在一个临时目录
|
boolean |
hasFile(long fId,
String suffix)
判断文件池中是否存在一个文件
|
File |
removeDir(long fId)
从池中删除一个临时目录,如果文件不存在,返回null
|
File |
removeFile(long fId,
String suffix)
从池中删除一个文件,如果文件不存在,返回null
|
File |
returnDir(long fId)
获取一个临时目录,如果临时目录不存在,创建它
|
File |
returnFile(long fId,
String suffix)
获取一个文件,如果文件不存在,创建它
|
public SynchronizedFilePool(FilePool proxy)
public boolean hasFile(long fId, String suffix)
FilePool
public File removeFile(long fId, String suffix)
FilePool
removeFile
in interface FilePool
fId
- 文件IDsuffix
- 文件后缀名public File createFile(String suffix)
FilePool
createFile
in interface FilePool
suffix
- 文件的后缀public long getFileId(File f)
FilePool
public File getFile(long fId, String suffix)
FilePool
public File returnFile(long fId, String suffix)
FilePool
returnFile
in interface FilePool
public boolean hasDir(long fId)
FilePool
public File removeDir(long fId)
FilePool
public File getDir(long fId)
FilePool
public File returnDir(long fId)
FilePool
Copyright © 2017. All rights reserved.