AlexanderAshitkin commented on code in PR #392:
URL:
https://github.com/apache/maven-build-cache-extension/pull/392#discussion_r2404824496
##########
src/main/java/org/apache/maven/buildcache/CacheUtils.java:
##########
@@ -170,12 +175,21 @@ public FileVisitResult visitFile(Path path,
BasicFileAttributes basicFileAttribu
throws IOException {
if (matcher == null ||
matcher.matches(path.getFileName())) {
- final ZipEntry zipEntry =
- new ZipEntry(dir.relativize(path).toString());
- zipOutputStream.putNextEntry(zipEntry);
+ final ZipArchiveEntry zipEntry =
+ new
ZipArchiveEntry(dir.relativize(path).toString());
+
+ // Preserve Unix permissions if available
+ try {
+ Set<PosixFilePermission> permissions =
Files.getPosixFilePermissions(path);
+
zipEntry.setUnixMode(permissionsToMode(permissions));
+ } catch (UnsupportedOperationException e) {
Review Comment:
can it be checked once instead of repeatedly throwing and swallowing
exceptions?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]