java.lang.Object | |
↳ | org.apache.helix.ExternalCommand |
Wrapper for running commands outside of the JVM
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
LOG | |||||||||||
MODULE |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Initialize with a ProcessBuilder
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an external process from the command.
| |||||||||||
Creates an external process from the command.
| |||||||||||
see
destroy()
| |||||||||||
Executes the external command in the given working directory and waits for it to be
finished.
| |||||||||||
Executes the external command in the given working directory and waits (until timeout
is elapsed) for it to be finished.
| |||||||||||
Get the contents of the error stream after completion
| |||||||||||
Get the contents of the output stream after completion
| |||||||||||
Returns the error as a string.
| |||||||||||
Returns the error as a string.
| |||||||||||
Returns the output as a string.
| |||||||||||
Returns the output as a string.
| |||||||||||
After creating the command, you have to start it...
| |||||||||||
Creates an external process from the command.
| |||||||||||
Properly waits until everything is complete: joins on the thread that
reads the output, joins on the thread that reads the error and finally
wait for the process to be finished.
| |||||||||||
Properly waits until everything is complete: joins on the thread that
reads the output, joins on the thread that reads the error and finally
wait for the process to be finished.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Initialize with a ProcessBuilder
processBuilder | initialized ProcessBuilder object |
---|
Creates an external process from the command. It is not started and you have to call start on it!
commands | the command to execute |
---|
Creates an external process from the command. It is not started and you have to call start on it!
commands | the command to execute |
---|
Executes the external command in the given working directory and waits for it to be finished.
workingDirectory | the root directory from where to run the command |
---|---|
command | the command to execute (should be relative to the working directory |
args | the arguments to the command |
IOException | |
---|---|
InterruptedException |
Executes the external command in the given working directory and waits (until timeout is elapsed) for it to be finished.
workingDirectory | the root directory from where to run the command |
---|---|
command | the command to execute (should be relative to the working directory |
timeout | the maximum amount of time to wait for this external command (in ms). If this value is less than or equal to 0, timeout is ignored |
args | the arguments to the command |
Get the contents of the error stream after completion
InterruptedException | the process was interrupted before completion |
---|
Get the contents of the output stream after completion
InterruptedException | the process was interrupted before completion |
---|
Returns the error as a string.
encoding | the encoding scheme, e.g. "UTF-8" |
---|
InterruptedException | the process was interrupted before completion |
---|---|
UnsupportedEncodingException | the encoding scheme is invalid |
Returns the error as a string. Uses encoding "UTF-8".
InterruptedException | the process was interrupted before completion |
---|
Returns the output as a string.
encoding | string encoding scheme, e.g. "UTF-8" |
---|
InterruptedException | the process was interrupted before completion |
---|---|
UnsupportedEncodingException | the encoding scheme is invalid |
Returns the output as a string. Uses encoding "UTF-8".
InterruptedException | the process was interrupted before completion |
---|
Creates an external process from the command. The command is executed.
commands | the commands to execute |
---|
IOException | if there is an error |
---|
Properly waits until everything is complete: joins on the thread that
reads the output, joins on the thread that reads the error and finally
wait for the process to be finished.
If the process has not completed before the timeout, throws a TimeoutException
TimeoutException | the process timed out |
---|---|
InterruptedException | the process was interrupted before completion |
Properly waits until everything is complete: joins on the thread that reads the output, joins on the thread that reads the error and finally wait for the process to be finished.
InterruptedException | the process was interrupted before completion |
---|