public class CommandLine
extends java.lang.Object
Constructor and Description |
---|
CommandLine(java.lang.String[] cmdarray) |
CommandLine(java.lang.String executable,
java.lang.String... args) |
Modifier and Type | Method and Description |
---|---|
void |
checkForError() |
void |
copyOutputTo(java.io.OutputStream out) |
int |
destroy()
Destroy the current command.
|
void |
execute() |
void |
executeAsync() |
static java.lang.String |
find(java.lang.String executable)
Deprecated.
Use the commandline itself to execute your command.
|
(package private) java.util.Map<java.lang.String,java.lang.String> |
getEnvironment() |
int |
getExitCode() |
static java.lang.String |
getLibraryPathPropertyName() |
java.lang.String |
getStdOut() |
boolean |
isRunning()
Check whether the current command is still executing.
|
boolean |
isSuccessful() |
void |
setDynamicLibraryPath(java.lang.String newLibraryPath) |
void |
setEnvironmentVariable(java.lang.String name,
java.lang.String value)
Adds the specified environment variable.
|
void |
setEnvironmentVariables(java.util.Map<java.lang.String,java.lang.String> environment)
Adds the specified environment variables.
|
void |
setInput(java.lang.String allInput) |
void |
setWorkingDirectory(java.lang.String workingDirectory) |
java.lang.String |
toString() |
void |
waitFor() |
void |
waitFor(long timeout) |
private OsProcess process
public CommandLine(java.lang.String executable, java.lang.String... args)
public CommandLine(java.lang.String[] cmdarray)
java.util.Map<java.lang.String,java.lang.String> getEnvironment()
public void setEnvironmentVariables(java.util.Map<java.lang.String,java.lang.String> environment)
environment
- the variables to addjava.lang.IllegalArgumentException
- if any value given is null (unsupported)public void setEnvironmentVariable(java.lang.String name, java.lang.String value)
name
- the name of the environment variablevalue
- the value of the environment variablejava.lang.IllegalArgumentException
- if the value given is null (unsupported)public void setDynamicLibraryPath(java.lang.String newLibraryPath)
public static java.lang.String getLibraryPathPropertyName()
@Deprecated public static java.lang.String find(java.lang.String executable)
executable
- executable name to be foundpublic void executeAsync()
public void execute()
public void waitFor()
public void waitFor(long timeout)
public boolean isSuccessful()
public int getExitCode()
public java.lang.String getStdOut()
public int destroy()
public boolean isRunning()
public void setInput(java.lang.String allInput)
public void setWorkingDirectory(java.lang.String workingDirectory)
public java.lang.String toString()
toString
in class java.lang.Object
public void copyOutputTo(java.io.OutputStream out)
public void checkForError()