public abstract class BaseRedirectorHelperTask
extends org.apache.tools.ant.Task
Modifier and Type | Field and Description |
---|---|
protected boolean |
alwaysLog
Flag which indicates that, if redirected, output should also be always
sent to the log.
|
protected boolean |
failOnError
Whether to fail (with a BuildException) if ManagerServlet returns an
error.
|
protected OutputStream |
redirectErrStream
The stream for error output
|
protected org.apache.tools.ant.taskdefs.Redirector |
redirector
Redirector helper
|
protected boolean |
redirectorConfigured
will be set to
true when the configuration of the Redirector
is complete. |
protected org.apache.tools.ant.types.RedirectorElement |
redirectorElement
Redirector element for this task
|
protected boolean |
redirectOutput
true true when output redirection is requested for this task. |
protected OutputStream |
redirectOutStream
The stream for info output
|
Constructor and Description |
---|
BaseRedirectorHelperTask() |
Modifier and Type | Method and Description |
---|---|
void |
addConfiguredRedirector(org.apache.tools.ant.types.RedirectorElement redirectorElement)
Add a
RedirectorElement to this task. |
protected void |
closeRedirector()
Ask redirector to close all the streams.
|
protected void |
handleErrorFlush(String output)
Handles error output with the ERR priority and flushes the stream.
|
protected void |
handleErrorOutput(String output)
Handles error output with the ERR priority.
|
protected void |
handleFlush(String output)
Handles output with the INFO priority and flushes the stream.
|
protected void |
handleOutput(String output)
Handles output with the INFO priority.
|
protected void |
handleOutput(String output,
int priority)
Handles output with ERR priority to error stream and all other priorities
to output stream.
|
boolean |
isFailOnError()
Returns the value of the failOnError property.
|
protected void |
openRedirector()
Set up properties on the Redirector and create output streams.
|
void |
setAlwaysLog(boolean alwaysLog)
If true, (error and non-error) output will be redirected as specified
while being sent to Ant's logging mechanism as if no redirection had
taken place.
|
void |
setAppend(boolean append)
If true, append output to existing file.
|
void |
setCreateEmptyFiles(boolean createEmptyFiles)
Whether output and error files should be created even when empty.
|
void |
setError(File error)
File the error output of the task is redirected to.
|
void |
setErrorProperty(String errorProperty)
Property name whose value should be set to the error of the task.
|
void |
setFailonerror(boolean fail)
Whether to fail (with a BuildException) if ManagerServlet returns an
error.
|
void |
setLogError(boolean logError)
Controls whether error output is logged.
|
void |
setOutput(File out)
File the output of the task is redirected to.
|
void |
setOutputproperty(String outputProperty)
Property name whose value should be set to the output of the task.
|
bindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleInput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
protected org.apache.tools.ant.taskdefs.Redirector redirector
protected org.apache.tools.ant.types.RedirectorElement redirectorElement
protected OutputStream redirectOutStream
protected OutputStream redirectErrStream
protected boolean failOnError
protected boolean redirectOutput
true
true when output redirection is requested for this task.
Default is to log on Ant log.protected boolean redirectorConfigured
true
when the configuration of the Redirector
is complete.protected boolean alwaysLog
public void setFailonerror(boolean fail)
fail
- The new value of failonerrorpublic boolean isFailOnError()
true
if the task should will if an error occurs,
otherwise false
public void setOutput(File out)
out
- name of the output filepublic void setError(File error)
error
- name of the error filepublic void setLogError(boolean logError)
logError
- if true the standard error is sent to the Ant log system
and not sent to output stream.public void setOutputproperty(String outputProperty)
outputProperty
- property namepublic void setErrorProperty(String errorProperty)
errorProperty
- property namepublic void setAppend(boolean append)
append
- if true, append output to existing filepublic void setAlwaysLog(boolean alwaysLog)
Redirector
itself.alwaysLog
- boolean
public void setCreateEmptyFiles(boolean createEmptyFiles)
createEmptyFiles
- boolean
.public void addConfiguredRedirector(org.apache.tools.ant.types.RedirectorElement redirectorElement)
RedirectorElement
to this task.redirectorElement
- RedirectorElement
.protected void openRedirector()
protected void closeRedirector()
protected void handleOutput(String output)
handleOutput
in class org.apache.tools.ant.Task
output
- The output to log. Should not be null
.protected void handleFlush(String output)
handleFlush
in class org.apache.tools.ant.Task
output
- The output to log. Should not be null
.protected void handleErrorOutput(String output)
handleErrorOutput
in class org.apache.tools.ant.Task
output
- The error output to log. Should not be null
.protected void handleErrorFlush(String output)
handleErrorFlush
in class org.apache.tools.ant.Task
output
- The error output to log. Should not be null
.protected void handleOutput(String output, int priority)
output
- The output to log. Should not be null
.priority
- The priority level that should be usedCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.