|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.unlogic.standardutils.exec.ExecUtils
public class ExecUtils
Utility class for executing processes and handling the output from them.
Constructor Summary | |
---|---|
ExecUtils()
|
Method Summary | |
---|---|
static int |
execAndWait(ProcessBuilder builder,
OutputStream outputStream,
Long timeout)
Executes the given command and waits for the resulting processes to terminate and all data written to standard out and error out to be handled. |
static int |
execAndWait(String command,
Long timeout)
Executes the given command and waits for the resulting processes to terminate and all data written to standard out and error out to be handled. |
static int |
execAndWait(String command,
OutputStream outputStream,
Long timeout)
Executes the given command and waits for the resulting processes to terminate and all data written to standard out and error out to be handled. |
static int |
execAndWait(String command,
StreamHandler stdOutHandler,
StreamHandler errorOutHandler,
Long timeout)
Executes the given command and waits for the resulting processes to terminate and all data written to standard out and error out to be handled. |
static int |
waitForProcessAndStreams(Process proc,
StreamHandler stdOutHandler,
StreamHandler errorOutHandler,
Long timeout)
Waits for the given processes to terminate and all data written to standard out and error out to be handled. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExecUtils()
Method Detail |
---|
public static int execAndWait(String command, Long timeout) throws IOException, InterruptedException
All data written to standard out is piped to System.out with the given prefix
All data written to error out is piped to System.err with the given prefix
command
- the command to executedtimeout
- an optional timeout that controls how long the process i allowed to run before it is killed
IOException
InterruptedException
public static int execAndWait(String command, StreamHandler stdOutHandler, StreamHandler errorOutHandler, Long timeout) throws IOException, InterruptedException
command
- the command to executedstdOutHandler
- the StreamHandler
to handle all output the process writes on standard outerrorOutHandler
- the StreamHandler
to handle all output the process writes on error outtimeout
- an optional timeout that controls how long the process i allowed to run before it is killed
IOException
InterruptedException
public static int execAndWait(String command, OutputStream outputStream, Long timeout) throws IOException, InterruptedException
All data written to standard out and error out is piped to the given OutputStream
command
- the command to executedoutputStream
- the OutputStream
to handle all output of the processtimeout
- an optional timeout that controls how long the process i allowed to run before it is killed
IOException
InterruptedException
public static int execAndWait(ProcessBuilder builder, OutputStream outputStream, Long timeout) throws IOException, InterruptedException
All data written to standard out and error out is piped to the given OutputStream
builder
- the ProcessBuilder to get to start the Process throughoutputStream
- the OutputStream
to handle all output of the processtimeout
- an optional timeout that controls how long the process i allowed to run before it is killed
IOException
InterruptedException
public static int waitForProcessAndStreams(Process proc, StreamHandler stdOutHandler, StreamHandler errorOutHandler, Long timeout) throws InterruptedException
All data written to standard out and error out is piped to the given OutputStream
command
- the command to executedoutputStream
- the OutputStream
to handle all output of the process
IOException
InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |