public final class UNIXUtils
extends java.lang.Object
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.
Modifier and Type | Method and Description |
---|---|
static void |
changeOwnershipOfDirectory(java.lang.String dir,
java.lang.String user,
org.apache.commons.exec.Executor executor)
Change the ownership of a directory (recursively).
|
static void |
createUser(java.lang.String user,
java.lang.String group,
org.apache.commons.exec.Executor executor)
Create user on the system.
|
public static void createUser(java.lang.String user, @Nullable java.lang.String group, org.apache.commons.exec.Executor executor) throws java.io.IOException
user
- user idgroup
- group idexecutor
- the command executorjava.io.IOException
- If the user or group could not be created.public static void changeOwnershipOfDirectory(java.lang.String dir, java.lang.String user, org.apache.commons.exec.Executor executor) throws java.io.IOException
dir
- The directory to change the ownership of.user
- Userid of the user.executor
- the command executorjava.io.IOException
- if the operation fails