| Modifiers | Name | Description |
|---|---|---|
protected static ErrorService |
errorService |
|
protected static FileHandler |
instance |
|
protected static AttachmentService |
service |
|
protected static AbstractStorageService |
storageService |
| Constructor and description |
|---|
FileHandler
(AttachmentService attachmentService) |
| Type | Name and description |
|---|---|
Integer |
delete(List<Attachment> attachments) |
Integer |
deleteData(List<String> saveNames, List<String> syncIds) |
void |
deleteDataRetry() |
void |
deleteLocalFiles(Attachment att)删除附件的本地存储文件 |
protected void |
deleteLocals(Attachment att, Map options) |
protected static void |
deleteLocals(List<java.io.File> files) |
boolean |
exists(Attachment att) |
boolean |
existsData(String saveName, String syncId) |
java.io.InputStream |
getDataInputStream(String saveName, String syncId) |
EncodedInputStreamWrapper |
getEncodedInputStream(javax.servlet.http.HttpServletRequest request, Attachment att) |
java.io.InputStream |
getInputStream(String savePath, String saveName, Long fileSize, String syncId) |
java.io.InputStream |
getInputStream(Attachment att) |
static FileHandler |
getInstance(AttachmentService attachmentService = null) |
Long |
getLength(Attachment att)重新计算文件大小 |
protected java.io.InputStream |
getLocalInputStream(java.io.File file, Long fileSize) |
String |
getMd5(Attachment att)重新计算文件的 MD5 |
String |
getUrl(Attachment att, String contentType) |
boolean |
isStorageEnabled() |
boolean |
saveData(Attachment att, java.io.InputStream is, Map options)通过附件数据存储服务,将附件存储到其他地方 |
static FileHandler |
setInstance(FileHandler fileHandler) |
boolean |
shouldKeepLocalCopy(String fileName, Long fileSize) |
| Methods inherited from class | Name |
|---|---|
class Object |
Object#wait(long, int), Object#wait(long), Object#wait(), Object#equals(Object), Object#toString(), Object#hashCode(), Object#getClass(), Object#notify(), Object#notifyAll() |
删除附件的本地存储文件
重新计算文件大小
重新计算文件的 MD5
通过附件数据存储服务,将附件存储到其他地方
如果转储成功,会自动设置附件的 syncId 属性。
options.deleteOnFailed - 如果转储失败,是否删除已保存的附件和文件,默认为否options.deleteOnSuccess - 如果转储成功,是否删除本地文件,默认为否BROPEN Documentation, 2020-04-21 11:00