|
@@ -2,6 +2,7 @@ package com.gis.common.util;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.gis.common.base.exception.BaseRuntimeException;
|
|
|
import com.gis.common.constant.ConfigConstant;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -106,9 +107,12 @@ public class FileUtils {
|
|
|
* @param path 参数是相对地址
|
|
|
*/
|
|
|
public void del(String path){
|
|
|
- String delPath = configConstant.serverBasePath + path;
|
|
|
- FileUtil.del(delPath);
|
|
|
- log.info("真删除文件: {}", delPath);
|
|
|
+ if (StrUtil.isNotBlank(path)){
|
|
|
+ String delPath = configConstant.serverBasePath + path;
|
|
|
+ FileUtil.del(delPath);
|
|
|
+ log.info("真删除文件: {}", delPath);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|