Commit 7911edec authored by 陈精华's avatar 陈精华 Committed by kl

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

parent 7ea70bf4
...@@ -39,6 +39,9 @@ public class SimTextFilePreviewImpl implements FilePreview{ ...@@ -39,6 +39,9 @@ public class SimTextFilePreviewImpl implements FilePreview{
try { try {
File originFile = new File(response.getContent()); File originFile = new File(response.getContent());
File previewFile = new File(response.getContent() + ".txt"); File previewFile = new File(response.getContent() + ".txt");
if (previewFile.exists()) {
previewFile.delete();
}
Files.copy(originFile.toPath(), previewFile.toPath()); Files.copy(originFile.toPath(), previewFile.toPath());
} catch (IOException e) { } catch (IOException e) {
model.addAttribute("msg", e.getLocalizedMessage()); model.addAttribute("msg", e.getLocalizedMessage());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment