| | |
| | | |
| | | private static int downloadPath = 1; |
| | | |
| | | private static int exportPath = 1; |
| | | |
| | | private static int uploadPath = 1; |
| | | |
| | | private static int sharePath = 1; |
| | |
| | | return downloadPath; |
| | | } |
| | | |
| | | public static int getExportPath() { |
| | | return exportPath; |
| | | } |
| | | |
| | | public static int getUploadPath() { |
| | | return uploadPath; |
| | | } |
| | |
| | | */ |
| | | public void init() { |
| | | downloadPath = getSubPath(config.getDownloadPath(), downloadPath); |
| | | exportPath = getSubPath(config.getExportPath(), exportPath); |
| | | uploadPath = getSubPath(config.getUploadPath(), uploadPath); |
| | | sharePath = getSubPath(config.getSharePath(), sharePath); |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取出图完整目录 |
| | | */ |
| | | public String getExportFullPath() { |
| | | exportPath = getSubPath(config.getExportPath(), exportPath); |
| | | |
| | | return config.getExportPath() + File.separator + exportPath; |
| | | } |
| | | |
| | | /** |
| | | * 获取上传完整目录 |
| | | */ |
| | | public String getUploadFullPath() { |
| | |
| | | /** |
| | | * 获取临时路径 |
| | | */ |
| | | 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()) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取临时路径 |
| | | */ |
| | | 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) { |