Package de.uplanet.util
Class ExecWrapper
java.lang.Object
de.uplanet.util.ExecWrapper
Wrap child processes.
Note: this class is not thread-safe.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
exec()
Executes the process.int
Executes the process and waits for termination until the given timeout has been reached.Get the error output of the child process.Get the standard output of the child process.
-
Constructor Details
-
ExecWrapper
-
-
Method Details
-
exec
Executes the process. Waits indeterminately until the prcess terminates.- Returns:
- The exit code of the child process.
- Throws:
IOException
- if any occursInterruptedException
- if any occurs
-
exec
public int exec(long p_lTimeout, TimeUnit p_timeUnit) throws IOException, InterruptedException, ExecWrapper.TimeoutException Executes the process and waits for termination until the given timeout has been reached.- Parameters:
p_lTimeout
- timeout value to wait for the process to terminate.p_timeUnit
- timeunit of the time out value- Returns:
- The exit code of the child process
- Throws:
IOException
- if any occursInterruptedException
- if any occursExecWrapper.TimeoutException
- if any occurs
-
getStdOut
Get the standard output of the child process.- Returns:
- The stdout output of the child process, or
null
if there was no such output.
-
getStdErr
Get the error output of the child process.- Returns:
- The stderr output of the child process, or
null
if there was no such output.
-