org.apache.tools.ant.taskdefs
Class Concat
This class contains the 'concat' task, used to concatenate a series
of files into a single stream. The destination of this stream may
be the system console, or a file. The following is a sample
invocation:
<concat destfile="${build.dir}/index.xml"
append="false">
<fileset dir="${xml.root.dir}"
includes="*.xml" />
</concat>
void | addFilelist(FileList list) - List of files to concatenate.
|
void | addFileset(FileSet set) - Set of files to concatenate.
|
void | addFilterChain(FilterChain filterChain) - Adds a FilterChain.
|
void | addFooter(Concat.TextElement footer) - Add a footer to the concatenated output
|
void | addHeader(Concat.TextElement header) - Add a header to the concatenated output
|
void | addText(String text) - This method adds text which appears in the 'concat' element.
|
Path | createPath() - Path of files to concatenate.
|
void | execute() - This method performs the concatenation.
|
void | reset() - Reset state to default.
|
void | setAppend(boolean append) - Sets the behavior when the destination file exists.
|
void | setBinary(boolean binary) - set the binary attribute.
|
void | setDestfile(File destinationFile) - Sets the destination file, or uses the console if not specified.
|
void | setEncoding(String encoding) - Sets the character encoding
|
void | setEol(FixCRLF.CrLf crlf) - Specify the end of line to find and to add if
not present at end of each input file.
|
void | setFixLastLine(boolean fixLastLine) - Append line.separator to files that do not end
with a line.separator, default false.
|
void | setForce(boolean force) - Force overwrite existing destination file
|
void | setOutputEncoding(String outputEncoding) - Sets the character encoding for outputting
|
void | setWriter(Writer outputWriter) - set the output writer, this is to allow
concat to be used as a nested element
|
execute , getDescription , getLocation , getOwningTarget , getRuntimeConfigurableWrapper , getTaskName , getTaskType , getWrapper , handleErrorFlush , handleErrorOutput , handleFlush , handleInput , handleOutput , init , isInvalid , log , log , maybeConfigure , perform , reconfigure , setDescription , setLocation , setOwningTarget , setRuntimeConfigurableWrapper , setTaskName , setTaskType |
addFilelist
public void addFilelist(FileList list)
List of files to concatenate.
list
- the list of files
addFileset
public void addFileset(FileSet set)
Set of files to concatenate.
set
- the set of files
addFilterChain
public void addFilterChain(FilterChain filterChain)
Adds a FilterChain.
filterChain
- a filterchain to filter the concatenated input
- Ant 1.6
addFooter
public void addFooter(Concat.TextElement footer)
Add a footer to the concatenated output
footer
- the footer
- Ant 1.6
addHeader
public void addHeader(Concat.TextElement header)
Add a header to the concatenated output
header
- the header
- Ant 1.6
addText
public void addText(String text)
This method adds text which appears in the 'concat' element.
text
- the text to be concated.
createPath
public Path createPath()
Path of files to concatenate.
- the path used for concatenating
- Ant 1.6
execute
public void execute()
This method performs the concatenation.
- execute in interface Task
reset
public void reset()
Reset state to default.
setAppend
public void setAppend(boolean append)
Sets the behavior when the destination file exists. If set to
true
the stream data will be appended to the
existing file, otherwise the existing file will be
overwritten. Defaults to false
.
append
- if true append to the file.
setBinary
public void setBinary(boolean binary)
set the binary attribute.
if true, concat will concatenate the files
byte for byte. This mode does not allow
any filtering, or other modifications
to the input streams.
The default value is false.
binary
- if true, enable binary mode
- ant 1.6.2
setDestfile
public void setDestfile(File destinationFile)
Sets the destination file, or uses the console if not specified.
destinationFile
- the destination file
setEncoding
public void setEncoding(String encoding)
Sets the character encoding
encoding
- the encoding of the input stream and unless
outputencoding is set, the outputstream.
setEol
public void setEol(FixCRLF.CrLf crlf)
Specify the end of line to find and to add if
not present at end of each input file. This attribute
is used in conjunction with fixlastline.
crlf
- the type of new line to add -
cr, mac, lf, unix, crlf, or dos
- Ant 1.6
setFixLastLine
public void setFixLastLine(boolean fixLastLine)
Append line.separator to files that do not end
with a line.separator, default false.
fixLastLine
- if true make sure each input file has
new line on the concatenated stream
- Ant 1.6
setForce
public void setForce(boolean force)
Force overwrite existing destination file
force
- if true always overwrite, otherwise only overwrite
if the output file is older any of the input files.
- Ant 1.6
setOutputEncoding
public void setOutputEncoding(String outputEncoding)
Sets the character encoding for outputting
outputEncoding
- the encoding for the output file
- Ant 1.6
setWriter
public void setWriter(Writer outputWriter)
set the output writer, this is to allow
concat to be used as a nested element
outputWriter
- the output writer
- Ant 1.6
Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.