cowwoc commented on code in PR #392:
URL:
https://github.com/apache/maven-build-cache-extension/pull/392#discussion_r2423325882
##########
src/main/java/org/apache/maven/buildcache/CacheUtils.java:
##########
@@ -217,4 +253,83 @@ public static <T> void debugPrintCollection(
}
}
}
+
+ /**
+ * Convert POSIX file permissions to Unix mode integer.
+ *
+ * @param permissions POSIX file permissions
+ * @return Unix mode as integer (e.g., {@code 0100755} for regular file
with {@code rwxr-xr-x})
+ */
+ private static int permissionsToMode(Set<PosixFilePermission> permissions)
{
+ // Start with regular file type (0100000 in octal)
+ int mode = 0100000;
+
+ if (permissions.contains(PosixFilePermission.OWNER_READ)) {
+ mode |= 0400;
+ }
+ if (permissions.contains(PosixFilePermission.OWNER_WRITE)) {
+ mode |= 0200;
+ }
+ if (permissions.contains(PosixFilePermission.OWNER_EXECUTE)) {
+ mode |= 0100;
+ }
+ if (permissions.contains(PosixFilePermission.GROUP_READ)) {
Review Comment:
I agree. This was an oversight on my part.
--
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]