管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-11-19 ec73287c65a85795a940871bf42656efbf845f64
src/main/java/com/lf/server/helper/PathHelper.java
@@ -112,22 +112,9 @@
            file.mkdirs();
        }
        deleteOldPath(config.getTempPath());
        return path;
    }
    /**
     * 获取临时路径名称
     */
    public String getTempPathName() {
        String tempName = StringHelper.YMDHMS2_FORMAT.format(new Date());
        String path = config.getTempPath() + File.separator + tempName;
        File file = new File(path);
        if (!file.exists() && !file.isDirectory()) {
            file.mkdirs();
        }
        return tempName;
    }
    /**
@@ -143,10 +130,29 @@
            }
        }
        deleteOldPath(config.getTempPath());
        return getTempPath();
    }
    /**
     * 获取临时路径名称
     */
    public String getTempPathName() {
        String tempName = StringHelper.YMDHMS2_FORMAT.format(new Date());
        String path = config.getTempPath() + File.separator + tempName;
        File file = new File(path);
        if (!file.exists() && !file.isDirectory()) {
            file.mkdirs();
        }
        deleteOldPath(config.getTempPath());
        return tempName;
    }
    /**
     * 删除旧路径
     */
    public void deleteOldPath(String tempPath) {