public class CommandLine extends Object
| 构造器和说明 |
|---|
CommandLine(String[] cmdarray) |
CommandLine(String executable,
String... args) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
checkForError() |
void |
copyOutputTo(OutputStream out) |
int |
destroy()
Destroy the current command.
|
void |
execute() |
void |
executeAsync() |
static String |
find(String executable)
已过时。
Use the commandline itself to execute your command.
|
int |
getExitCode() |
static String |
getLibraryPathPropertyName() |
String |
getStdOut() |
boolean |
isRunning()
Check whether the current command is still executing.
|
boolean |
isSuccessful() |
void |
setDynamicLibraryPath(String newLibraryPath) |
void |
setEnvironmentVariable(String name,
String value)
Adds the specified environment variable.
|
void |
setEnvironmentVariables(Map<String,String> environment)
Adds the specified environment variables.
|
void |
setInput(String allInput) |
void |
setWorkingDirectory(String workingDirectory) |
String |
toString() |
void |
waitFor() |
void |
waitFor(long timeout) |
public CommandLine(String[] cmdarray)
public void setEnvironmentVariables(Map<String,String> environment)
environment - the variables to addIllegalArgumentException - if any value given is null (unsupported)public void setEnvironmentVariable(String name, String value)
name - the name of the environment variablevalue - the value of the environment variableIllegalArgumentException - if the value given is null (unsupported)public void setDynamicLibraryPath(String newLibraryPath)
public static String getLibraryPathPropertyName()
@Deprecated public static String find(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 String getStdOut()
public int destroy()
public boolean isRunning()
public void setInput(String allInput)
public void setWorkingDirectory(String workingDirectory)
public void copyOutputTo(OutputStream out)
public void checkForError()