管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-11-17 15375a1d0d07c61c132906ff8da45f67bcd711f6
src/main/java/com/lf/server/helper/PathHelper.java
@@ -103,10 +103,10 @@
    /**
     * 获取临时路径
     */
    public String getTempPath(int id) {
        String tempName = StringHelper.YMD__FORMAT.format(new Date());
    public String getTempPath() {
        String tempName = StringHelper.YMDHMS2_FORMAT.format(new Date());
        String tempPath = config.getTempPath();
        String path = tempPath + File.separator + tempName + id;
        String path = tempPath + File.separator + tempName;
        File file = new File(path);
        if (!file.exists() && !file.isDirectory()) {
@@ -122,6 +122,22 @@
    }
    /**
     * 获取临时路径
     */
    public String getTempPath(String subPath) {
        if (!StringHelper.isEmpty(subPath)) {
            String path = config.getTempPath() + File.separator + subPath;
            File file = new File(path);
            if (file.exists() && file.isDirectory()) {
                return path;
            }
        }
        return getTempPath();
    }
    /**
     * 删除旧路径
     */
    public void deleteOldPath(String tempPath) {