public class RunProcess
extends java.lang.Object
构造器和说明 |
---|
RunProcess(java.io.File workingDirectory,
java.lang.String... command)
Creates new
RunProcess instance for the specified working directory and
command. |
RunProcess(java.lang.String... command)
Creates new
RunProcess instance for the specified command. |
限定符和类型 | 方法和说明 |
---|---|
java.lang.Process |
getRunningProcess()
Return the running process.
|
boolean |
handleSigInt()
Return if the process was stopped.
|
boolean |
hasJustEnded() |
void |
kill()
Kill this process.
|
int |
run(boolean waitForProcess,
java.util.Collection<java.lang.String> args,
java.util.Map<java.lang.String,java.lang.String> environmentVariables) |
int |
run(boolean waitForProcess,
java.lang.String... args) |
public RunProcess(java.lang.String... command)
RunProcess
instance for the specified command.command
- the program to execute and its argumentspublic RunProcess(java.io.File workingDirectory, java.lang.String... command)
RunProcess
instance for the specified working directory and
command.workingDirectory
- the working directory of the child process or null
to run in the working directory of the current Java processcommand
- the program to execute and its argumentspublic int run(boolean waitForProcess, java.lang.String... args) throws java.io.IOException
java.io.IOException
public int run(boolean waitForProcess, java.util.Collection<java.lang.String> args, java.util.Map<java.lang.String,java.lang.String> environmentVariables) throws java.io.IOException
java.io.IOException
public java.lang.Process getRunningProcess()
null
public boolean handleSigInt()
true
if stoppedpublic void kill()
public boolean hasJustEnded()