Package com.netflix.genie.web.util
Class UNIXUtils
java.lang.Object
com.netflix.genie.web.util.UNIXUtils
Utility class for UNIX user and file permissions.
N.B. These are some old routines moved out from JobKickoffTask for reuse as part of V3 to V4 migration. This class is expected to be deleted once execution is delegated to Agent.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
changeOwnershipOfDirectory
(String dir, String user, org.apache.commons.exec.Executor executor) Change the ownership of a directory (recursively).static void
createUser
(String user, String group, org.apache.commons.exec.Executor executor) Create user on the system.
-
Method Details
-
createUser
public static void createUser(String user, @Nullable String group, org.apache.commons.exec.Executor executor) throws IOException Create user on the system.- Parameters:
user
- user idgroup
- group idexecutor
- the command executor- Throws:
IOException
- If the user or group could not be created.
-
changeOwnershipOfDirectory
public static void changeOwnershipOfDirectory(String dir, String user, org.apache.commons.exec.Executor executor) throws IOException Change the ownership of a directory (recursively).- Parameters:
dir
- The directory to change the ownership of.user
- Userid of the user.executor
- the command executor- Throws:
IOException
- if the operation fails
-