提交 df360f3d 编写于 作者: O o2null

Merge branch 'fix/一键下载文件标题特殊字符处理' into 'wrdp'

【流程平台】修复一键下载文件标题包含特殊字符问题

See merge request o2oa/o2oa!1837
...@@ -163,7 +163,7 @@ public class GeneralFile extends StorageObject { ...@@ -163,7 +163,7 @@ public class GeneralFile extends StorageObject {
@FieldDescribe("文件名称.") @FieldDescribe("文件名称.")
@Column(length = length_255B, name = ColumnNamePrefix + name_FIELDNAME) @Column(length = length_255B, name = ColumnNamePrefix + name_FIELDNAME)
@Index(name = TABLE + IndexNameMiddle + name_FIELDNAME) @Index(name = TABLE + IndexNameMiddle + name_FIELDNAME)
@CheckPersist(allowEmpty = false, fileNameString = true) @CheckPersist(allowEmpty = false)
private String name; private String name;
public static final String extension_FIELDNAME = "extension"; public static final String extension_FIELDNAME = "extension";
......
...@@ -1229,8 +1229,8 @@ public class Business { ...@@ -1229,8 +1229,8 @@ public class Business {
} }
try (ZipOutputStream zos = new ZipOutputStream(os)) { try (ZipOutputStream zos = new ZipOutputStream(os)) {
for (Map.Entry<String, Attachment> entry : filePathMap.entrySet()) { for (Map.Entry<String, Attachment> entry : filePathMap.entrySet()) {
zos.putNextEntry(new ZipEntry(new ZipEntry(StringUtils.replaceEach(entry.getKey(), zos.putNextEntry(new ZipEntry(StringUtils.replaceEach(entry.getKey(),
new String[] { "/", "\\" }, new String[] { "-", "-" })))); new String[] { "/",":","*","?","<<",">>","|","<",">","\\" }, new String[] { "","","","","","","","","","" })));
StorageMapping mapping = ThisApplication.context().storageMappings().get(Attachment.class, StorageMapping mapping = ThisApplication.context().storageMappings().get(Attachment.class,
entry.getValue().getStorage()); entry.getValue().getStorage());
try (ByteArrayOutputStream os1 = new ByteArrayOutputStream()) { try (ByteArrayOutputStream os1 = new ByteArrayOutputStream()) {
...@@ -1243,8 +1243,8 @@ public class Business { ...@@ -1243,8 +1243,8 @@ public class Business {
if (otherAttMap != null) { if (otherAttMap != null) {
for (Map.Entry<String, byte[]> entry : otherAttMap.entrySet()) { for (Map.Entry<String, byte[]> entry : otherAttMap.entrySet()) {
zos.putNextEntry(new ZipEntry(StringUtils.replaceEach(entry.getKey(), new String[] { "/", "\\" }, zos.putNextEntry(new ZipEntry(StringUtils.replaceEach(entry.getKey(),
new String[] { "-", "-" }))); new String[] { "/",":","*","?","<<",">>","|","<",">","\\" }, new String[] { "","","","","","","","","","" })));
zos.write(entry.getValue()); zos.write(entry.getValue());
} }
} }
......
...@@ -100,7 +100,8 @@ class ActionBatchDownloadWithWorkOrWorkCompleted extends BaseAction { ...@@ -100,7 +100,8 @@ class ActionBatchDownloadWithWorkOrWorkCompleted extends BaseAction {
emc.commit(); emc.commit();
} }
} }
fileName = StringUtils.replaceEach(fileName,
new String[] { "/",":","*","?","<<",">>","|","<",">","\\" }, new String[] { "","","","","","","","","","" });
logger.info("batchDown to {},att size {}, from work {}", fileName, attachmentList.size(), workId); logger.info("batchDown to {},att size {}, from work {}", fileName, attachmentList.size(), workId);
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) { try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
business.downToZip(readableAttachmentList, os, map); business.downToZip(readableAttachmentList, os, map);
......
...@@ -101,6 +101,8 @@ class ActionBatchDownloadWithWorkOrWorkCompletedStream extends BaseAction { ...@@ -101,6 +101,8 @@ class ActionBatchDownloadWithWorkOrWorkCompletedStream extends BaseAction {
} }
} }
fileName = StringUtils.replaceEach(fileName,
new String[] { "/",":","*","?","<<",">>","|","<",">","\\" }, new String[] { "","","","","","","","","","" });
logger.info("batchDown to {},att size {}, from work {}, has form {}", fileName, attachmentList.size(), logger.info("batchDown to {},att size {}, from work {}, has form {}", fileName, attachmentList.size(),
workId, map.size()); workId, map.size());
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) { try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
......
...@@ -42,7 +42,7 @@ import com.x.processplatform.core.entity.content.WorkCompleted; ...@@ -42,7 +42,7 @@ import com.x.processplatform.core.entity.content.WorkCompleted;
class ActionUploadWorkInfo extends BaseAction { class ActionUploadWorkInfo extends BaseAction {
private static Logger logger = LoggerFactory.getLogger(ActionEdit.class); private static Logger logger = LoggerFactory.getLogger(ActionUploadWorkInfo.class);
ActionResult<Wo> execute(EffectivePerson effectivePerson, String workId, String flag, JsonElement jsonElement) ActionResult<Wo> execute(EffectivePerson effectivePerson, String workId, String flag, JsonElement jsonElement)
throws Exception { throws Exception {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册