Package org.apache.tools.ant.types
Class RedirectorElement
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.RedirectorElement
-
Field Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfiguredErrorMapper(Mapper errorMapper) Add the error file mapper.voidaddConfiguredInputMapper(Mapper inputMapper) Add the input file mapper.voidaddConfiguredOutputMapper(Mapper outputMapper) Add the output file mapper.voidconfigure(Redirector redirector) Configure the specifiedRedirector.voidconfigure(Redirector redirector, String sourcefile) Configure the specifiedRedirectorfor the specified sourcefile.Create a nested errorFilterChain.Create a nested inputFilterChain.protected MappercreateMergeMapper(File destfile) Create a merge mapper pointing to the specified destination file.Create a nested outputFilterChain.protected voiddieOnCircularReference(Stack<Object> stk, Project p) Overrides the version of DataType to recurse on all DataType child elements that may have been added.voidsetAlwaysLog(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.voidsetAppend(boolean append) Whether output should be appended to or overwrite an existing file.voidsetBinaryOutput(boolean b) Whether to consider the output created by the process binary.voidsetCreateEmptyFiles(boolean createEmptyFiles) Whether output and error files should be created even when empty.voidSet the file to which standard error is to be redirected.voidsetErrorEncoding(String errorEncoding) Set the error encoding.voidsetErrorProperty(String errorProperty) Property name whose value should be set to the error of the process.voidSet the input to use for the task.voidsetInputEncoding(String inputEncoding) Set the input encoding.voidsetInputString(String inputString) Set the string to use as inputvoidsetLogError(boolean logError) Controls whether error output of exec is logged.voidsetLogInputString(boolean logInputString) Set whether to include the value of the input string in log messages.voidFile the output of the process is redirected to.voidsetOutputEncoding(String outputEncoding) Set the output encoding.voidsetOutputProperty(String outputProperty) Property name whose value should be set to the output of the process.voidMake this instance in effect a reference to another instance.protected File[]toFileArray(String[] name) Return aFile[]from the specified set of filenames.Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes, toStringMethods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
Constructor Details
-
RedirectorElement
public RedirectorElement()
-
-
Method Details
-
addConfiguredInputMapper
Add the input file mapper.- Parameters:
inputMapper-Mapper.
-
addConfiguredOutputMapper
Add the output file mapper.- Parameters:
outputMapper-Mapper.
-
addConfiguredErrorMapper
Add the error file mapper.- Parameters:
errorMapper-Mapper.
-
setRefid
Make this instance in effect a reference to another instance.You must not set another attribute or nest elements inside this element if you make it a reference.
- Overrides:
setRefidin classDataType- Parameters:
r- the reference to use.- Throws:
BuildException- on error.
-
setInput
Set the input to use for the task.- Parameters:
input- the file from which input is read.
-
setInputString
Set the string to use as input- Parameters:
inputString- the string which is used as the input source
-
setLogInputString
public void setLogInputString(boolean logInputString) Set whether to include the value of the input string in log messages. Defaults to true.- Parameters:
logInputString- true or false.- Since:
- Ant 1.7
-
setOutput
File the output of the process is redirected to. If error is not redirected, it too will appear in the output.- Parameters:
out- the file to which output stream is written.
-
setOutputEncoding
Set the output encoding.- Parameters:
outputEncoding-String.
-
setErrorEncoding
Set the error encoding.- Parameters:
errorEncoding-String.
-
setInputEncoding
Set the input encoding.- Parameters:
inputEncoding-String.
-
setLogError
public void setLogError(boolean logError) Controls whether error output of exec is logged. This is only useful when output is being redirected and error output is desired in the Ant log.- Parameters:
logError- if true the standard error is sent to the Ant log system and not sent to output.
-
setError
Set the file to which standard error is to be redirected.- Parameters:
error- the file to which error is to be written.
-
setOutputProperty
Property name whose value should be set to the output of the process.- Parameters:
outputProperty- the name of the property to be set with the task's output.
-
setAppend
public void setAppend(boolean append) Whether output should be appended to or overwrite an existing file. Defaults to false.- Parameters:
append- if true output and error streams are appended to their respective files, if specified.
-
setAlwaysLog
public 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. Defaults to false.- Parameters:
alwaysLog-boolean- Since:
- Ant 1.6.3
-
setCreateEmptyFiles
public void setCreateEmptyFiles(boolean createEmptyFiles) Whether output and error files should be created even when empty. Defaults to true.- Parameters:
createEmptyFiles-boolean.
-
setErrorProperty
Property name whose value should be set to the error of the process.- Parameters:
errorProperty- the name of the property to be set with the error output.
-
createInputFilterChain
Create a nested inputFilterChain.- Returns:
FilterChain.
-
createOutputFilterChain
Create a nested outputFilterChain.- Returns:
FilterChain.
-
createErrorFilterChain
Create a nested errorFilterChain.- Returns:
FilterChain.
-
setBinaryOutput
public void setBinaryOutput(boolean b) Whether to consider the output created by the process binary.Binary output will not be split into lines which may make error and normal output look mixed up when they get written to the same stream.
- Parameters:
b- boolean- Since:
- 1.9.4
-
configure
Configure the specifiedRedirector.- Parameters:
redirector-Redirector.
-
configure
Configure the specifiedRedirectorfor the specified sourcefile.- Parameters:
redirector-Redirector.sourcefile-String.
-
createMergeMapper
-
toFileArray
-
dieOnCircularReference
Overrides the version of DataType to recurse on all DataType child elements that may have been added.- Overrides:
dieOnCircularReferencein classDataType- Parameters:
stk- the stack of data types to use (recursively).p- the project to use to dereference the references.- Throws:
BuildException- on error.
-