Explorar el Código

上传文件添加前缀分隔符

caixiaofeng hace 10 meses
padre
commit
d8a05de585

+ 2 - 2
flow-file/flow-file-biz/src/main/java/com/flow/utils/FileUtil.java

@@ -18,7 +18,7 @@ public class FileUtil {
         String fileName = file.getOriginalFilename();
         try {
             // 路径
-            String path = filePath +format +fileName;
+            String path = String.format("%s%s_%s", filePath, format, fileName);
             File dest = new File(path).getCanonicalFile();
             // 检测是否存在目录
             if (!dest.getParentFile().exists()) {
@@ -36,7 +36,7 @@ public class FileUtil {
         return null;
     }
 
-    public static void del(String filePath){
+    public static void del(String filePath) {
         if (filePath != null && filePath.length() > 0) {
             File file = new File(filePath);
             if (file.exists()) {