|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.tools.ant.taskdefs.Redirector
The Redirector class manages the setup and connection of input and output redirection for an Ant task.
| Constructor Summary | |
Redirector(Task managingTask)
Create a redirector instance for the given task |
|
| Method Summary | |
void |
complete()
Complete redirection. |
ExecuteStreamHandler |
createHandler()
Create the StreamHandler to use with our Execute instance. |
void |
createStreams()
Create the input, error and output streams based on the configuration options. |
java.io.OutputStream |
getErrorStream()
Get the error stream for the redirector |
java.io.InputStream |
getInputStream()
Get the input stream for the redirector |
java.io.OutputStream |
getOutputStream()
Get the output stream for the redirector |
protected void |
handleErrorFlush(java.lang.String output)
Handle a flush operation on the error stream |
protected void |
handleErrorOutput(java.lang.String output)
Process error output |
protected void |
handleFlush(java.lang.String output)
Process data due to a flush operation. |
protected int |
handleInput(byte[] buffer,
int offset,
int length)
Handle an input request |
protected void |
handleOutput(java.lang.String output)
Pass output sent to System.out to specified output. |
void |
setAppend(boolean append)
Whether output should be appended to or overwrite an existing file. |
void |
setError(java.io.File error)
Set the file to which standard error is to be redirected. |
void |
setErrorProperty(java.lang.String errorProperty)
Property name whose value should be set to the error of the process. |
void |
setInput(java.io.File input)
Set the input to use for the task |
void |
setInputString(java.lang.String inputString)
Set the string to use as input |
void |
setLogError(boolean logError)
Controls whether error output of exec is logged. |
void |
setOutput(java.io.File out)
File the output of the process is redirected to. |
void |
setOutputProperty(java.lang.String outputProperty)
Property name whose value should be set to the output of the process. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Redirector(Task managingTask)
managingTask - the task for which the redirector is to work| Method Detail |
public void setInput(java.io.File input)
input - the file from which input is read.public void setInputString(java.lang.String inputString)
inputString - the string which is used as the input sourcepublic void setOutput(java.io.File out)
out - the file to which output stream is writtenpublic void setLogError(boolean logError)
logError - if true the standard error is sent to the Ant log system
and not sent to output.public void setError(java.io.File error)
error - the file to which error is to be writtenpublic void setOutputProperty(java.lang.String outputProperty)
outputProperty - the name of the property to be set with the
task's output.public void setAppend(boolean append)
append - if true output and error streams are appended to their
respective files, if specified.public void setErrorProperty(java.lang.String errorProperty)
errorProperty - the name of the property to be set
with the error output.public void createStreams()
public ExecuteStreamHandler createHandler()
throws BuildException
BuildException - if the execute stream handler cannot be created.protected void handleOutput(java.lang.String output)
output - the data to be output
protected int handleInput(byte[] buffer,
int offset,
int length)
throws java.io.IOException
buffer - the buffer into which data is to be read.offset - the offset into the buffer at which data is stored.length - the amount of data to read
java.io.IOException - if the data cannot be readprotected void handleFlush(java.lang.String output)
output - the data being flushed.protected void handleErrorOutput(java.lang.String output)
output - the error output data.protected void handleErrorFlush(java.lang.String output)
output - the error information being flushed.public java.io.OutputStream getOutputStream()
public java.io.OutputStream getErrorStream()
public java.io.InputStream getInputStream()
public void complete()
throws java.io.IOException
java.io.IOException - if the output properties cannot be read from their
output streams.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||