Class UNIXUtils

java.lang.Object
com.netflix.genie.web.util.UNIXUtils

public final class UNIXUtils extends Object
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 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 id
      group - group id
      executor - 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