管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2022-10-31 5fe2473ba0e9f374da27e919fdce09b0915f5e51
src/main/java/com/lf/server/helper/PathHelper.java
@@ -19,7 +19,7 @@
    @Autowired
    private PropertiesConfig config;
    private static int importPath = 1;
    private static int downloadPath = 1;
    private static int exportPath = 1;
@@ -35,8 +35,8 @@
        return config;
    }
    public static int getImportPath() {
        return importPath;
    public static int getDownloadPath() {
        return downloadPath;
    }
    public static int getExportPath() {
@@ -55,7 +55,7 @@
     * 初始化
     */
    public void init() {
        importPath = getSubPath(config.getImportPath(), importPath);
        downloadPath = getSubPath(config.getDownloadPath(), downloadPath);
        exportPath = getSubPath(config.getExportPath(), exportPath);
        uploadPath = getSubPath(config.getUploadPath(), uploadPath);
        sharePath = getSubPath(config.getSharePath(), sharePath);
@@ -84,9 +84,9 @@
     * 获取导入目录
     */
    public String getImportFullPath() {
        importPath = getSubPath(config.getImportPath(), importPath);
        downloadPath = getSubPath(config.getDownloadPath(), downloadPath);
        return config.getImportPath() + File.separator + importPath;
        return config.getDownloadPath() + File.separator + downloadPath;
    }
    /**
@@ -119,10 +119,10 @@
    /**
     * 获取临时路径
     */
    public String getTempPath() {
        String tempName = StringHelper.YMD_HM_FORMAT.format(new Date());
    public String getTempPath(int id) {
        String tempName = StringHelper.YMD__FORMAT.format(new Date());
        String tempPath = config.getTempPath();
        String path = tempPath + File.separator + tempName;
        String path = tempPath + File.separator + tempName + id;
        File file = new File(path);
        if (!file.exists() && !file.isDirectory()) {
@@ -154,7 +154,7 @@
                deleteFiles(f);
            }
        } catch (Exception ex) {
            log.error(ex.getMessage() + ex.getStackTrace() + "\n");
            log.error(ex.getMessage(), ex);
        }
    }