解压方案新版测试修复乱码Linux问题

This commit is contained in:
BearBen
2021-12-17 09:23:32 +08:00
committed by kl
parent 4d1e2eb9c6
commit 20f328906c
7 changed files with 227 additions and 55 deletions

View File

@ -40,16 +40,7 @@ public class CompressFilePreviewImpl implements FilePreview {
return otherFilePreview.notSupportedFile(model, fileAttribute, response.getMsg());
}
String filePath = response.getContent();
if ("zip".equalsIgnoreCase(suffix) || "jar".equalsIgnoreCase(suffix) || "gzip".equalsIgnoreCase(suffix)) {
fileTree = compressFileReader.readZipFile(filePath, fileName);
} else if ("rar".equalsIgnoreCase(suffix)) {
fileTree = compressFileReader.unRar(filePath, fileName);
} else if ("7z".equalsIgnoreCase(suffix)) {
fileTree = compressFileReader.read7zFile(filePath, fileName);
}
if (fileTree != null && !"null".equals(fileTree) && ConfigConstants.isCacheEnabled()) {
fileHandlerService.addConvertedFile(fileName, fileTree);
}
fileTree = compressFileReader.unRar(filePath, fileName);
} else {
fileTree = fileHandlerService.getConvertedFile(fileName);
}
@ -57,7 +48,7 @@ public class CompressFilePreviewImpl implements FilePreview {
model.addAttribute("fileTree", fileTree);
return COMPRESS_FILE_PREVIEW_PAGE;
} else {
return otherFilePreview.notSupportedFile(model, fileAttribute, "压缩文件类型不受支持尝试在压缩的时候选择RAR4格式");
return otherFilePreview.notSupportedFile(model, fileAttribute, "压缩文件类型不受支持");
}
}
}