ruanwenjun commented on code in PR #12486:
URL:
https://github.com/apache/dolphinscheduler/pull/12486#discussion_r1002498286
##########
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/utils/TaskExecutionCheckerUtils.java:
##########
@@ -131,4 +138,23 @@ public static void
downloadResourcesIfNeeded(StorageOperate storageOperate,
}
}
}
+
+ private static void createDirectoryWithOwner(Path filePath, String tenant)
{
+ if (Files.exists(filePath)) {
+ return;
+ }
+ try {
+ Files.createDirectories(filePath);
+ if (!OSUtils.isSudoEnable()) {
+ // we need to open sudo, then we can change the owner.
+ return;
+ }
+ UserPrincipalLookupService userPrincipalLookupService =
+ FileSystems.getDefault().getUserPrincipalLookupService();
+ UserPrincipal tenantPrincipal =
userPrincipalLookupService.lookupPrincipalByName(tenant);
+ Files.setOwner(filePath, tenantPrincipal);
Review Comment:
Yes, we use standard jdk api, this can work in mac.
--
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]