修复:文本文档首次预览后缓存文件未清理问题

pull/12/head
陈精华 2019-11-05 13:38:27 +08:00 committed by kl
parent 7ea70bf422
commit 7911edec4b
1 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,9 @@ public class SimTextFilePreviewImpl implements FilePreview{
try {
File originFile = new File(response.getContent());
File previewFile = new File(response.getContent() + ".txt");
if (previewFile.exists()) {
previewFile.delete();
}
Files.copy(originFile.toPath(), previewFile.toPath());
} catch (IOException e) {
model.addAttribute("msg", e.getLocalizedMessage());