meethngala commented on code in PR #3616:
URL: https://github.com/apache/gobblin/pull/3616#discussion_r1095295658
##########
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/writer/FileAwareInputStreamDataWriter.java:
##########
@@ -500,15 +504,26 @@ private void ensureDirectoryExists(FileSystem fs, Path
path, Iterator<OwnerAndPe
String group = ownerAndPermission.getGroup();
String owner = ownerAndPermission.getOwner();
+ List<AclEntry> aclEntries = ownerAndPermission.getAclEntries();
if (group != null || owner != null) {
log.debug("Applying owner {} and group {} to path {}.", owner, group,
path);
fs.setOwner(path, owner, group);
}
+ if (!aclEntries.isEmpty()) {
+ setAclOnPath(fs, path, aclEntries);
+ }
} else {
fs.mkdirs(path);
}
}
+ /*
+ * Creating an abstraction layer to support unit testing on raw local file
system for validating if ACLs are set on a file path
+ */
+ protected void setAclOnPath(FileSystem theFs, Path path, List<AclEntry>
aclEntries) throws IOException {
+ theFs.setAcl(path, aclEntries);
+ }
Review Comment:
Yes, I agree. I have extended LocalFileSystem to support setAcl and handle
it accordingly for the purpose of unit testing in my latest commit. I no longer
create this additional layer of abstraction.
--
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]