public class CmdRunner
extends java.lang.Object
Constructor and Description |
---|
CmdRunner() |
Modifier and Type | Method and Description |
---|---|
static void |
addEnviroment(java.lang.String enviromentVariable,
java.lang.String value) |
static java.lang.String |
getOsName() |
static boolean |
isWindows() |
void |
run(java.lang.String[] runStr,
boolean runAndWait)
Essentialy a wrapper for Runtime.getRuntime().exec() that waits and catches exceptions.
|
void |
run(java.lang.String commandLine,
char delimiter)
Run command line, wait and catch exceptions
|
java.lang.String[] |
runAndGetOutput(java.lang.String command,
char delimiter) |
void |
runLater(java.lang.String commandLine,
char delimiter)
Run command line and do not wait for process to end
|
public void run(java.lang.String[] runStr, boolean runAndWait)
runStr
- runAndWait
- True - wait for process to end, False - do not wait for process to endpublic static void addEnviroment(java.lang.String enviromentVariable, java.lang.String value)
public void runLater(java.lang.String commandLine, char delimiter)
commandLine
- - command to run - must be executable at system command line.delimiter
- - character used to delimit parameters - must not occur inside parameters.public void run(java.lang.String commandLine, char delimiter)
commandLine
- - command to run - must be executable at system command line.delimiter
- - character used to delimit parameters - must not occur inside parameters.public java.lang.String[] runAndGetOutput(java.lang.String command, char delimiter)
command
- - (full) command to run - must be executable at system command line.delimiter
- - character used to delimit parameters - must not occur inside parameters.public static java.lang.String getOsName()
public static boolean isWindows()