mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-02-11 16:59:54 +08:00
fix(core): zipper lose the file attributes
This commit is contained in:
parent
916733a1e8
commit
05d2fbbbb9
@ -80,7 +80,7 @@ public final class Zipper implements Closeable {
|
|||||||
if (filter != null && !filter.test(relativePath.replace('\\', '/'))) {
|
if (filter != null && !filter.test(relativePath.replace('\\', '/'))) {
|
||||||
return FileVisitResult.SKIP_SUBTREE;
|
return FileVisitResult.SKIP_SUBTREE;
|
||||||
}
|
}
|
||||||
Files.copy(file, root.resolve(relativePath));
|
Files.copy(file, root.resolve(relativePath), StandardCopyOption.COPY_ATTRIBUTES);
|
||||||
return FileVisitResult.CONTINUE;
|
return FileVisitResult.CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,11 +104,11 @@ public final class Zipper implements Closeable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void putFile(Path file, String path) throws IOException {
|
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 {
|
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 {
|
public void putTextFile(String text, String path) throws IOException {
|
||||||
|
Loading…
Reference in New Issue
Block a user