Commit 23b8746e by songxiang

压缩包名称优化

parent 4012f52e
...@@ -120,8 +120,8 @@ public class CompressUtils { ...@@ -120,8 +120,8 @@ public class CompressUtils {
if (ListUtils.isEmpty(fileUrlList)) { if (ListUtils.isEmpty(fileUrlList)) {
return null; return null;
} }
zipName = FileUtils.formatName(zipName); String zipNameFormat = FileUtils.formatName(zipName);
String tempZipName = zipName + "_" + LocalDateUtils.getYmdhmss(); String tempZipName = zipNameFormat + "_" + LocalDateUtils.getYmdhmss();
String zipFilePath = ZIP_FILE_PATH + tempZipName + ".zip"; String zipFilePath = ZIP_FILE_PATH + tempZipName + ".zip";
// 检查临时文件夹是否存在,不存在就创建 // 检查临时文件夹是否存在,不存在就创建
String fileFolderPath = FILE_LOCAL_PATH + tempZipName; String fileFolderPath = FILE_LOCAL_PATH + tempZipName;
...@@ -141,7 +141,7 @@ public class CompressUtils { ...@@ -141,7 +141,7 @@ public class CompressUtils {
FileUtils.isDir(ZIP_FILE_PATH); FileUtils.isDir(ZIP_FILE_PATH);
CompressUtils.zip(fileFolderPath, zipFilePath); CompressUtils.zip(fileFolderPath, zipFilePath);
// 上传文件到服务器中 // 上传文件到服务器中
uploadResultInfo = OssUtils.uploadLocalFile4CustomName(zipFilePath, zipName); uploadResultInfo = OssUtils.uploadLocalFile4CustomName(zipFilePath, zipNameFormat);
uploadResultInfo.setFileName(zipName); uploadResultInfo.setFileName(zipName);
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("【压缩】压缩失败,<ERROR>:" + e.getMessage(), e); LOGGER.error("【压缩】压缩失败,<ERROR>:" + e.getMessage(), e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment