Package org.apache.commons.exec
Interface ExecuteStreamHandler
-
- All Known Implementing Classes:
PumpStreamHandler
public interface ExecuteStreamHandler
Used byExecute
to handle input and output stream of subprocesses.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
setProcessErrorStream(InputStream is)
Install a handler for the error stream of the subprocess.void
setProcessInputStream(OutputStream os)
Install a handler for the input stream of the subprocess.void
setProcessOutputStream(InputStream is)
Install a handler for the output stream of the subprocess.void
start()
Start handling of the streams.void
stop()
Stop handling of the streams - will not be restarted.
-
-
-
Method Detail
-
setProcessInputStream
void setProcessInputStream(OutputStream os) throws IOException
Install a handler for the input stream of the subprocess.- Parameters:
os
- output stream to write to the standard input stream of the subprocess- Throws:
IOException
- thrown when an I/O exception occurs.
-
setProcessErrorStream
void setProcessErrorStream(InputStream is) throws IOException
Install a handler for the error stream of the subprocess.- Parameters:
is
- input stream to read from the error stream from the subprocess- Throws:
IOException
- thrown when an I/O exception occurs.
-
setProcessOutputStream
void setProcessOutputStream(InputStream is) throws IOException
Install a handler for the output stream of the subprocess.- Parameters:
is
- input stream to read from the error stream from the subprocess- Throws:
IOException
- thrown when an I/O exception occurs.
-
start
void start() throws IOException
Start handling of the streams.- Throws:
IOException
- thrown when an I/O exception occurs.
-
stop
void stop() throws IOException
Stop handling of the streams - will not be restarted. Will wait for pump threads to complete.- Throws:
IOException
- thrown when an I/O exception occurs.
-
-