public class ProcessHelper extends Object
| 构造器和说明 |
|---|
ProcessHelper() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
closePidsByName(String processName)
Close pids by name.
|
static String |
getErrorResult()
Gets error result.
|
static String |
getStreamResult(Process process)
Gets stream result.
|
static String |
getStreamResult(Process process,
int timeOut)
Gets stream result.
|
static String |
getStreamResult(Process process,
int timeOut,
boolean throwError)
Gets stream result.
|
static String |
getStreamResult(Process process,
long timeOut,
boolean throwError,
boolean runGetErrorStream)
Gets stream result.
|
protected static String okResult
public static String getErrorResult()
public static void closePidsByName(String processName) throws IOException, InterruptedException, ExecutionException
processName - the process nameIOException - the io exceptionInterruptedException - the interrupted exceptionExecutionException - the execution exceptionpublic static String getStreamResult(Process process) throws InterruptedException, ExecutionException, IOException
process - the processInterruptedException - the interrupted exceptionExecutionException - the execution exceptionIOException - the io exceptionpublic static String getStreamResult(Process process, int timeOut) throws InterruptedException, ExecutionException, IOException
process - the processtimeOut - the time outInterruptedException - the interrupted exceptionExecutionException - the execution exceptionIOException - the io exceptionpublic static String getStreamResult(Process process, int timeOut, boolean throwError) throws InterruptedException, ExecutionException, IOException
process - the processtimeOut - the time outthrowError - the throw errorInterruptedException - the interrupted exceptionExecutionException - the execution exceptionIOException - the io exceptionpublic static String getStreamResult(Process process, long timeOut, boolean throwError, boolean runGetErrorStream) throws InterruptedException, ExecutionException, IOException
process - the processtimeOut - the time outthrowError - the throw errorrunGetErrorStream - the run get error streamInterruptedException - the interrupted exceptionExecutionException - the execution exceptionIOException - the io exceptionCopyright © 2017. All rights reserved.