| | |
| | | } |
| | | |
| | | /** |
| | | * 获取临时路径 |
| | | * @param companyId |
| | | * @return |
| | | */ |
| | | public String getTempFilePath(String companyId) { |
| | | |
| | | String basePath = FrameworkConfig.getProfile() + "TEMP/"; |
| | | if (org.apache.commons.lang3.StringUtils.isNotEmpty(companyId)) { |
| | | basePath += companyId + "/"; |
| | | } |
| | | File file = new File(basePath); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | return basePath; |
| | | } |
| | | |
| | | /** |
| | | * 获取模板路径 |
| | | * @return |
| | | */ |
| | | public String getConfPath() { |
| | | |
| | | String basePath = FrameworkConfig.getProfile() + "CONF/"; |
| | | File file = new File(basePath); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | | return basePath; |
| | | } |
| | | |
| | | /** |
| | | * 压缩图片 |
| | | * |
| | | * @param filePath 压缩前路径 |
| | |
| | | ImageIO.write(compressedImage, "jpg", new File(outputPath)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |