org.apache.tools.ant.taskdefs
public class Redirector extends Object
Since: Ant 1.6
Constructor Summary | |
---|---|
Redirector(Task managingTask)
Create a redirector instance for the given task
| |
Redirector(ProjectComponent 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. |
OutputStream | getErrorStream()
Get the error stream for the redirector
|
InputStream | getInputStream()
Get the input stream for the redirector
|
OutputStream | getOutputStream()
Get the output stream for the redirector
|
protected void | handleErrorFlush(String output)
Handle a flush operation on the error stream
|
protected void | handleErrorOutput(String output)
Process error output
|
protected void | handleFlush(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(String output)
Pass output sent to System.out to specified output.
|
void | setAlwaysLog(boolean alwaysLog)
If true, (error and non-error) output will be "teed", redirected
as specified while being sent to Ant's logging mechanism as if no
redirection had taken place. |
void | setAppend(boolean append)
Whether output should be appended to or overwrite an existing file.
|
void | setAppendProperties(boolean appendProperties)
This Redirector 's subordinate
PropertyOutputStream s will not set their respective
properties while (appendProperties && append) .
|
void | setCreateEmptyFiles(boolean createEmptyFiles)
Whether output and error files should be created even when empty.
|
void | setError(File error)
Set the file to which standard error is to be redirected.
|
void | setError(File[] error)
Set the files to which standard error is to be redirected.
|
void | setErrorEncoding(String errorEncoding)
Set the error encoding.
|
void | setErrorFilterChains(Vector errorFilterChains)
Set the error FilterChain s.
|
void | setErrorProperty(String errorProperty)
Property name whose value should be set to the error of
the process.
|
void | setInput(File input)
Set the input to use for the task
|
void | setInput(File[] input)
Set the input to use for the task
|
void | setInputEncoding(String inputEncoding)
Set the input encoding.
|
void | setInputFilterChains(Vector inputFilterChains)
Set the input FilterChain s.
|
void | setInputString(String inputString)
Set the string to use as input
|
void | setLogError(boolean logError)
Controls whether error output of exec is logged. |
void | setOutput(File out)
File the output of the process is redirected to. |
void | setOutput(File[] out)
Files the output of the process is redirected to. |
void | setOutputEncoding(String outputEncoding)
Set the output encoding.
|
void | setOutputFilterChains(Vector outputFilterChains)
Set the output FilterChain s.
|
void | setOutputProperty(String outputProperty)
Property name whose value should be set to the output of
the process.
|
void | setProperties()
Notify the Redirector that it is now okay
to set any output and/or error properties. |
Parameters: managingTask the task for which the redirector is to work
Parameters: managingTask the project component for which the redirector is to work
Since: Ant 1.6.3
Throws: IOException if the output properties cannot be read from their output streams.
Returns: the execute stream handler to manage the input, output and error streams.
Throws: BuildException if the execute stream handler cannot be created.
Returns: the redirector's error stream or null if no output has been configured
Returns: the redirector's input stream or null if no output has been configured
Returns: the redirector's output stream or null if no output has been configured
Parameters: output the error information being flushed.
Parameters: output the error output data.
Parameters: output the data being flushed.
Parameters: 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
Returns: the number of bytes read
Throws: IOException if the data cannot be read
Parameters: output the data to be output
Parameters: alwaysLog boolean
Since: Ant 1.6.3
Parameters: append if true output and error streams are appended to their respective files, if specified.
Redirector
's subordinate
PropertyOutputStream
s will not set their respective
properties while (appendProperties && append)
.
Parameters: appendProperties whether to append properties.
Parameters: createEmptyFiles boolean
.
Parameters: error the file to which error is to be written
Parameters: error the file to which error is to be written
Parameters: errorEncoding String
.
FilterChain
s.
Parameters: errorFilterChains Vector
containing FilterChain
.
Parameters: errorProperty the name of the property to be set with the error output.
Parameters: input the file from which input is read.
Parameters: input the files from which input is read.
Parameters: inputEncoding String
.
FilterChain
s.
Parameters: inputFilterChains Vector
containing FilterChain
.
Parameters: inputString the string which is used as the input source
Parameters: logError if true the standard error is sent to the Ant log system and not sent to output.
Parameters: out the file to which output stream is written
Parameters: out the files to which output stream is written
Parameters: outputEncoding String
.
FilterChain
s.
Parameters: outputFilterChains Vector
containing FilterChain
.
Parameters: outputProperty the name of the property to be set with the task's output.
Redirector
that it is now okay
to set any output and/or error properties.