From 9051cd3fac60196223031ed9d0839fe13b547304 Mon Sep 17 00:00:00 2001 From: shizhendong Date: Tue, 27 Aug 2024 14:15:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20pcap=20=E4=BF=9D=E5=AD=98=E6=97=B6=20nam?= =?UTF-8?q?e=3D=E6=BA=90=E6=96=87=E4=BB=B6=E5=90=8D=E7=A7=B0=EF=BC=8C?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=AD=98=E5=82=A8=E6=97=B6=20name=3D{pcap=5F?= =?UTF-8?q?id}+=E6=BA=90=E6=96=87=E4=BB=B6=E5=90=8E=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../asw/module/runner/service/impl/PcapServiceImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/geedge/asw/module/runner/service/impl/PcapServiceImpl.java b/src/main/java/net/geedge/asw/module/runner/service/impl/PcapServiceImpl.java index c827014..85ec946 100644 --- a/src/main/java/net/geedge/asw/module/runner/service/impl/PcapServiceImpl.java +++ b/src/main/java/net/geedge/asw/module/runner/service/impl/PcapServiceImpl.java @@ -146,10 +146,7 @@ public class PcapServiceImpl extends ServiceImpl implements try { String pcapId = IdWorker.get32UUID(); entity.setId(pcapId); - - String fileExtName = T.StrUtil.emptyToDefault(T.FileUtil.extName(fileResource.getFilename()), "pcap"); - String saveFileName = pcapId + "." + fileExtName; - entity.setName(saveFileName); + entity.setName(fileResource.getFilename()); entity.setDescription(description); byte[] bytes = fileResource.getInputStream().readAllBytes(); @@ -161,6 +158,8 @@ public class PcapServiceImpl extends ServiceImpl implements entity.setWorkspaceId(workspaceId); // path + String fileExtName = T.StrUtil.emptyToDefault(T.FileUtil.extName(fileResource.getFilename()), "pcap"); + String saveFileName = pcapId + "." + fileExtName; File destination = T.FileUtil.file(T.WebPathUtil.getRootPath(), workspaceId, saveFileName); FileUtils.copyInputStreamToFile(fileResource.getInputStream(), destination); entity.setPath(destination.getPath());