修复:文本文档首次预览后缓存文件未清理问题
parent
7ea70bf422
commit
7911edec4b
|
@ -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());
|
||||||
|
|
Loading…
Reference in New Issue