|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.exec.PumpStreamHandler
public class PumpStreamHandler
Copies standard output and error of subprocesses to standard output and error of the parent process. If output or error stream are set to null, any feedback from that stream will be lost.
Constructor Summary | |
---|---|
PumpStreamHandler()
Construct a new PumpStreamHandler . |
|
PumpStreamHandler(java.io.OutputStream outAndErr)
Construct a new PumpStreamHandler . |
|
PumpStreamHandler(java.io.OutputStream out,
java.io.OutputStream err)
Construct a new PumpStreamHandler . |
|
PumpStreamHandler(java.io.OutputStream out,
java.io.OutputStream err,
java.io.InputStream input)
Construct a new PumpStreamHandler . |
Method Summary | |
---|---|
protected void |
createProcessErrorPump(java.io.InputStream is,
java.io.OutputStream os)
Create the pump to handle error output. |
protected void |
createProcessOutputPump(java.io.InputStream is,
java.io.OutputStream os)
Create the pump to handle process output. |
protected java.lang.Thread |
createPump(java.io.InputStream is,
java.io.OutputStream os)
Creates a stream pumper to copy the given input stream to the given output stream. |
protected java.lang.Thread |
createPump(java.io.InputStream is,
java.io.OutputStream os,
boolean closeWhenExhausted)
Creates a stream pumper to copy the given input stream to the given output stream. |
protected java.io.OutputStream |
getErr()
Get the error stream. |
protected java.io.OutputStream |
getOut()
Get the output stream. |
void |
setProcessErrorStream(java.io.InputStream is)
Set the InputStream from which to read the standard error
of the process. |
void |
setProcessInputStream(java.io.OutputStream os)
Set the OutputStream by means of which input can be sent
to the process. |
void |
setProcessOutputStream(java.io.InputStream is)
Set the InputStream from which to read the standard output
of the process. |
void |
start()
Start the Thread s. |
void |
stop()
Stop pumping the streams. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PumpStreamHandler()
PumpStreamHandler
.
public PumpStreamHandler(java.io.OutputStream outAndErr)
PumpStreamHandler
.
outAndErr
- the output/error OutputStream
.public PumpStreamHandler(java.io.OutputStream out, java.io.OutputStream err)
PumpStreamHandler
.
out
- the output OutputStream
.err
- the error OutputStream
.public PumpStreamHandler(java.io.OutputStream out, java.io.OutputStream err, java.io.InputStream input)
PumpStreamHandler
.
out
- the output OutputStream
.err
- the error OutputStream
.input
- the input InputStream
.Method Detail |
---|
public void setProcessOutputStream(java.io.InputStream is)
InputStream
from which to read the standard output
of the process.
setProcessOutputStream
in interface ExecuteStreamHandler
is
- the InputStream
.public void setProcessErrorStream(java.io.InputStream is)
InputStream
from which to read the standard error
of the process.
setProcessErrorStream
in interface ExecuteStreamHandler
is
- the InputStream
.public void setProcessInputStream(java.io.OutputStream os)
OutputStream
by means of which input can be sent
to the process.
setProcessInputStream
in interface ExecuteStreamHandler
os
- the OutputStream
.public void start()
Thread
s.
start
in interface ExecuteStreamHandler
public void stop()
stop
in interface ExecuteStreamHandler
protected java.io.OutputStream getErr()
OutputStream
.protected java.io.OutputStream getOut()
OutputStream
.protected void createProcessOutputPump(java.io.InputStream is, java.io.OutputStream os)
is
- the InputStream
.os
- the OutputStream
.protected void createProcessErrorPump(java.io.InputStream is, java.io.OutputStream os)
is
- the InputStream
.os
- the OutputStream
.protected java.lang.Thread createPump(java.io.InputStream is, java.io.OutputStream os)
is
- the input stream to copy fromos
- the output stream to copy into
protected java.lang.Thread createPump(java.io.InputStream is, java.io.OutputStream os, boolean closeWhenExhausted)
is
- the input stream to copy fromos
- the output stream to copy intocloseWhenExhausted
- close the output stream when the input stream is exhausted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |