mbenson 2004/02/25 10:58:40
Modified: src/main/org/apache/tools/ant/taskdefs
PumpStreamHandler.java
Log:
Javadoc all public methods.
Revision Changes Path
1.18 +57 -4
ant/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java
Index: PumpStreamHandler.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/PumpStreamHandler.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- PumpStreamHandler.java 9 Feb 2004 21:05:20 -0000 1.17
+++ PumpStreamHandler.java 25 Feb 2004 18:58:40 -0000 1.18
@@ -25,8 +25,6 @@
* Copies standard output and error of subprocesses to standard output and
* error of the parent process.
*
- * TODO: standard input of the subprocess is not implemented.
- *
* @author [EMAIL PROTECTED]
* @since Ant 1.2
*/
@@ -40,6 +38,12 @@
private OutputStream err;
private InputStream input;
+ /**
+ * Construct a new <CODE>PumpStreamHandler</CODE>.
+ * @param out the output <CODE>OutputStream</CODE>.
+ * @param err the error <CODE>OutputStream</CODE>.
+ * @param in the input <CODE>InputStream</CODE>.
+ */
public PumpStreamHandler(OutputStream out, OutputStream err,
InputStream input) {
this.out = out;
@@ -47,29 +51,55 @@
this.input = input;
}
+ /**
+ * Construct a new <CODE>PumpStreamHandler</CODE>.
+ * @param out the output <CODE>OutputStream</CODE>.
+ * @param err the error <CODE>OutputStream</CODE>.
+ */
public PumpStreamHandler(OutputStream out, OutputStream err) {
this(out, err, null);
}
+ /**
+ * Construct a new <CODE>PumpStreamHandler</CODE>.
+ * @param outAndErr the output/error <CODE>OutputStream</CODE>.
+ */
public PumpStreamHandler(OutputStream outAndErr) {
this(outAndErr, outAndErr);
}
+ /**
+ * Construct a new <CODE>PumpStreamHandler</CODE>.
+ */
public PumpStreamHandler() {
this(System.out, System.err);
}
+ /**
+ * Set the <CODE>InputStream</CODE> from which to read the
+ * standard output of the process.
+ * @param is the <CODE>InputStream</CODE>.
+ */
public void setProcessOutputStream(InputStream is) {
createProcessOutputPump(is, out);
}
-
+ /**
+ * Set the <CODE>InputStream</CODE> from which to read the
+ * standard error of the process.
+ * @param is the <CODE>InputStream</CODE>.
+ */
public void setProcessErrorStream(InputStream is) {
if (err != null) {
createProcessErrorPump(is, err);
}
}
+ /**
+ * Set the <CODE>OutputStream</CODE> by means of which
+ * input can be sent to the process.
+ * @param os the <CODE>OutputStream</CODE>.
+ */
public void setProcessInputStream(OutputStream os) {
if (input != null) {
inputThread = createPump(input, os, true);
@@ -82,6 +112,9 @@
}
}
+ /**
+ * Start the <CODE>Thread</CODE>s.
+ */
public void start() {
outputThread.start();
errorThread.start();
@@ -90,6 +123,9 @@
}
}
+ /**
+ * Stop pumping the streams.
+ */
public void stop() {
try {
outputThread.join();
@@ -122,22 +158,39 @@
}
}
+ /**
+ * Get the error stream.
+ * @return <CODE>OutputStream</CODE>.
+ */
protected OutputStream getErr() {
return err;
}
+ /**
+ * Get the output stream.
+ * @return <CODE>OutputStream</CODE>.
+ */
protected OutputStream getOut() {
return out;
}
+ /**
+ * Create the pump to handle process output.
+ * @param is the <CODE>InputStream</CODE>.
+ * @param os the <CODE>OutputStream</CODE>.
+ */
protected void createProcessOutputPump(InputStream is, OutputStream os) {
outputThread = createPump(is, os);
}
+ /**
+ * Create the pump to handle error output.
+ * @param is the <CODE>InputStream</CODE>.
+ * @param os the <CODE>OutputStream</CODE>.
+ */
protected void createProcessErrorPump(InputStream is, OutputStream os) {
errorThread = createPump(is, os);
}
-
/**
* Creates a stream pumper to copy the given input stream to the
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]