本地存储, 文件不存在时, 给与友好提示

This commit is contained in:
zhaojun1998
2020-01-20 22:48:04 +08:00
parent 6c9150466c
commit 031607402a
5 changed files with 232 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
package im.zhaojun.local.controller;
import cn.hutool.core.util.URLUtil;
import im.zhaojun.common.exception.NotExistFileException;
import im.zhaojun.common.util.StringUtils;
import im.zhaojun.local.service.LocalServiceImpl;
import org.springframework.core.io.FileSystemResource;
@@ -42,7 +43,7 @@ public class LocalController {
private ResponseEntity<FileSystemResource> export(File file) {
if (!file.exists()) {
return ResponseEntity.notFound().build();
throw new NotExistFileException();
}