public interface CommandProcess extends AutoCloseable
false
.Modifier and Type | Method and Description |
---|---|
void |
flush()
Flush pending write operations.
|
boolean |
isClosed()
Check if current process has been closed.
|
boolean |
isRunning()
Check if current process is still opened.
|
String |
read()
Read output until a null line is read.
|
String |
read(OutputHandler handler)
Read output until:
A null line is read.
Handler returns false when line is read.
Since command process will not be closed, a simple string
is returned (an exit status cannot be computed).
|
void |
write(Iterable<String> inputs)
Write set of inputs to the current process.
|
void |
write(String input,
String... others)
Write input string to the current process.
|
close
String read() throws IOException
IOException
- If an error occurred during operation.String read(OutputHandler handler) throws IOException
handler
- Output handler.IOException
- If an error occurred during operation.void write(String input, String... others) throws IOException
input
- Input.others
- Other inputs.IOException
- If an error occurred during operation.void write(Iterable<String> inputs) throws IOException
inputs
- Collection of inputs.IOException
- If an error occurred during operation.void flush() throws IOException
IOException
boolean isRunning()
true
, then isClosed()
should return false
.true
if process is open, false
otherwise.boolean isClosed()
true
, then isRunning()
should return false
.true
if process is closed, false
otherwise.Copyright © 2015. All Rights Reserved.