mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2025-09-18 09:44:37 +08:00
修复:文本文档首次预览后缓存文件未清理问题
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user