From 24faa6c603791d8a008ed9e7ab1c6c46e5f209c5 Mon Sep 17 00:00:00 2001 From: "youhong.ai" Date: Tue, 18 Jul 2023 11:42:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=89=93=E5=8C=85=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/builderpackage/FileCompressor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/builderpackage/FileCompressor.java b/src/test/java/builderpackage/FileCompressor.java index 6d82d7c..d7fce1e 100644 --- a/src/test/java/builderpackage/FileCompressor.java +++ b/src/test/java/builderpackage/FileCompressor.java @@ -54,7 +54,9 @@ public class FileCompressor { if (StrUtil.isBlank(finalPath)) { finalPath = "/"; } - finalPath = finalPath.replace(File.separator, "/"); + if (!File.separator.equals("/")) { + finalPath = finalPath.replace(File.separator, "/"); + } ZipEntry zipEntry = new ZipEntry(finalPath); zipOutputStream.putNextEntry(zipEntry);