From 05d2fbbbb94ea5a7b8b05ded06eaa69fc6bc4390 Mon Sep 17 00:00:00 2001 From: SettingDust Date: Fri, 3 Dec 2021 21:19:54 +0800 Subject: [PATCH] fix(core): zipper lose the file attributes --- .../src/main/java/org/jackhuang/hmcl/util/io/Zipper.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/Zipper.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/Zipper.java index 3abb0b74e..219455d5b 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/Zipper.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/Zipper.java @@ -80,7 +80,7 @@ public final class Zipper implements Closeable { if (filter != null && !filter.test(relativePath.replace('\\', '/'))) { return FileVisitResult.SKIP_SUBTREE; } - Files.copy(file, root.resolve(relativePath)); + Files.copy(file, root.resolve(relativePath), StandardCopyOption.COPY_ATTRIBUTES); return FileVisitResult.CONTINUE; } @@ -104,11 +104,11 @@ public final class Zipper implements Closeable { } public void putFile(Path file, String path) throws IOException { - Files.copy(file, fs.getPath(path)); + Files.copy(file, fs.getPath(path), StandardCopyOption.COPY_ATTRIBUTES); } public void putStream(InputStream in, String path) throws IOException { - Files.copy(in, fs.getPath(path)); + Files.copy(in, fs.getPath(path), StandardCopyOption.COPY_ATTRIBUTES); } public void putTextFile(String text, String path) throws IOException {