类 RunProcess
- java.lang.Object
- org.springframework.boot.loader.tools.RunProcess
public class RunProcess extends Object
Utility used to run a process.- 从以下版本开始:
- 1.1.0
构造器概要
构造器 构造器 说明 RunProcess(File workingDirectory, String... command)Creates newRunProcessinstance for the specified working directory and command.RunProcess(String... command)Creates newRunProcessinstance for the specified command.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ProcessgetRunningProcess()Return the running process.booleanhandleSigInt()Return if the process was stopped.booleanhasJustEnded()voidkill()Kill this process.intrun(boolean waitForProcess, String... args)protected intrun(boolean waitForProcess, Collection<String> args)
构造器详细资料
RunProcess
public RunProcess(String... command)
Creates newRunProcessinstance for the specified command.- 参数:
command- the program to execute and its arguments
RunProcess
public RunProcess(File workingDirectory, String... command)
Creates newRunProcessinstance for the specified working directory and command.- 参数:
workingDirectory- the working directory of the child process ornullto run in the working directory of the current Java processcommand- the program to execute and its arguments
方法详细资料
run
public int run(boolean waitForProcess, String... args) throws IOException
- 抛出:
IOException
run
protected int run(boolean waitForProcess, Collection<String> args) throws IOException
- 抛出:
IOException
getRunningProcess
public Process getRunningProcess()
Return the running process.- 返回:
- the process or
null
handleSigInt
public boolean handleSigInt()
Return if the process was stopped.- 返回:
trueif stopped
kill
public void kill()
Kill this process.
hasJustEnded
public boolean hasJustEnded()