net.sf.antcontrib.cpptasks.compiler

Class CaptureStreamHandler

public class CaptureStreamHandler extends Object implements ExecuteStreamHandler

Implements ExecuteStreamHandler to capture the output of a Execute to an array of strings

Author: Curt Arnold

Constructor Summary
CaptureStreamHandler()
Method Summary
String[]getOutput()
static String[]run(String[] cmdline)
Runs an executable and captures the output in a String array
voidsetProcessErrorStream(InputStream is)
Install a handler for the error stream of the subprocess.
voidsetProcessInputStream(OutputStream os)
Install a handler for the input stream of the subprocess.
voidsetProcessOutputStream(InputStream is)
Install a handler for the output stream of the subprocess.
voidstart()
Start handling of the streams.
voidstop()
Stop handling of the streams - will not be restarted.

Constructor Detail

CaptureStreamHandler

public CaptureStreamHandler()

Method Detail

getOutput

public String[] getOutput()

run

public static String[] run(String[] cmdline)
Runs an executable and captures the output in a String array

Parameters: cmdline command line arguments

Returns: output of process

setProcessErrorStream

public void setProcessErrorStream(InputStream is)
Install a handler for the error stream of the subprocess.

Parameters: is input stream to read from the error stream from the subprocess

setProcessInputStream

public void setProcessInputStream(OutputStream os)
Install a handler for the input stream of the subprocess.

Parameters: os output stream to write to the standard input stream of the subprocess

setProcessOutputStream

public void setProcessOutputStream(InputStream is)
Install a handler for the output stream of the subprocess.

Parameters: is input stream to read from the error stream from the subprocess

start

public void start()
Start handling of the streams.

stop

public void stop()
Stop handling of the streams - will not be restarted.
Copyright ? 2001-2011 Ant-Contrib project. All Rights Reserved.