1.修复压缩包 二级目录无法解压问题 修改压缩包生成PDF路径

2.修复PDF 带密码缓存问题 新增PDF带密码缓存方法 userToken
3.精简OFFICE 转换代码
4.精简TIF转换代码 新增TIF转换图片缓存 修复tif错误文件不自动释放内存 等待其他修复
5.修复下载方法错 特殊符号下载错误
6.调整文件名 统一方法在FileHandlerService
7.新增判断文件名是否被URL转义
This commit is contained in:
gaoxiongzaq
2023-10-23 17:06:05 +08:00
parent c559efcceb
commit deb91728d4
15 changed files with 529 additions and 380 deletions

View File

@@ -39,6 +39,7 @@ public class CompressFilePreviewImpl implements FilePreview {
String fileName=fileAttribute.getName();
String filePassword = fileAttribute.getFilePassword();
boolean forceUpdatedCache=fileAttribute.forceUpdatedCache();
String fileKey = fileAttribute.getFileKey(); //判断是否压缩包
String fileTree = null;
// 判断文件名是否存在(redis缓存读取)
if (forceUpdatedCache || !StringUtils.hasText(fileHandlerService.getConvertedFile(fileName)) || !ConfigConstants.isCacheEnabled()) {
@@ -48,7 +49,7 @@ public class CompressFilePreviewImpl implements FilePreview {
}
String filePath = response.getContent();
try {
fileTree = compressFileReader.unRar(filePath, filePassword,fileName);
fileTree = compressFileReader.unRar(filePath, filePassword,fileName,fileKey);
} catch (Exception e) {
Throwable[] throwableArray = ExceptionUtils.getThrowables(e);
for (Throwable throwable : throwableArray) {
@@ -62,7 +63,7 @@ public class CompressFilePreviewImpl implements FilePreview {
}
if (!ObjectUtils.isEmpty(fileTree)) {
//是否保留压缩包源文件
if (ConfigConstants.getDeleteSourceFile()) {
if (ObjectUtils.isEmpty(fileKey) && ConfigConstants.getDeleteSourceFile()) {
KkFileUtils.deleteFileByPath(filePath);
}
if (ConfigConstants.isCacheEnabled()) {