public class ShellCommandUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
LINUX
Set to true when run on Linux platforms
|
static boolean |
MAC
Set to true when run on Mac OS platforms
|
static String |
MASK_EVERYBODY_RWX
Permission mask 777 allows everybody to read/modify/execute file
|
static String |
MASK_OWNER_ONLY_RW
Permission mask 600 allows only owner to read and modify file.
|
static boolean |
UNIX_LIKE
Set to true when run if platform is detected to be UNIX compatible
|
static boolean |
WINDOWS
Set to true when run on Windows platforms
|
| Constructor and Description |
|---|
ShellCommandUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getOpenSslCommandResult(String command,
int exitCode) |
static String |
getUnixFilePermissions(String path)
Gets file permissions on Linux systems.
|
static String |
hideOpenSslPassword(String command) |
static void |
logOpenSslExitCode(String command,
int exitCode) |
static org.apache.ambari.server.utils.ShellCommandUtil.Result |
runCommand(String[] args) |
static void |
setUnixFilePermissions(String mode,
String path)
Sets file permissions to a given value on Linux systems.
|
public static final boolean WINDOWS
public static final boolean LINUX
public static final boolean MAC
public static final boolean UNIX_LIKE
public static final String MASK_OWNER_ONLY_RW
public static final String MASK_EVERYBODY_RWX
public static void logOpenSslExitCode(String command, int exitCode)
public static String getUnixFilePermissions(String path)
path - public static void setUnixFilePermissions(String mode, String path)
mode - path - public static org.apache.ambari.server.utils.ShellCommandUtil.Result runCommand(String[] args) throws IOException, InterruptedException
IOExceptionInterruptedExceptionCopyright © 2016. All rights reserved.