| | |
| | | @Autowired |
| | | private PropertiesConfig config; |
| | | |
| | | private static int importPath = 1; |
| | | private static int downloadPath = 1; |
| | | |
| | | private static int exportPath = 1; |
| | | |
| | |
| | | return config; |
| | | } |
| | | |
| | | public static int getImportPath() { |
| | | return importPath; |
| | | public static int getDownloadPath() { |
| | | return downloadPath; |
| | | } |
| | | |
| | | public static int getExportPath() { |
| | |
| | | * 初始化 |
| | | */ |
| | | 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); |
| | |
| | | * 获取导入目录 |
| | | */ |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 获取临时路径 |
| | | */ |
| | | public String getTempPath() { |
| | | String tempName = StringHelper.getDateFormat4(); |
| | | 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()) { |
| | |
| | | deleteFiles(f); |
| | | } |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage() + ex.getStackTrace() + "\n"); |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | |