Skip to content

Commit

Permalink
devonfw#799: fix zip extraction to preserve file attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille committed Dec 5, 2024
1 parent 4769719 commit 66bcb2a
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ private void copyRecursive(Path source, Path target, FileCopyMode mode) throws I
}
this.context.trace("Copying {} to {}", source, target);
Files.copy(source, target);
Object attribute = Files.getAttribute(source, "zip:permissions");
if (attribute instanceof Set permissionSet) {
Files.setPosixFilePermissions(target, permissionSet);
}
} else {
throw new IOException("Path " + source + " does not exist.");
}
Expand Down

0 comments on commit 66bcb2a

Please sign in to comment.