public class Concat extends Task implements ResourceCollection
<concat destfile="${build.dir}/index.xml" append="false"> <fileset dir="${xml.root.dir}" includes="*.xml" /> </concat>
Modifier and Type | Class and Description |
---|---|
static class |
Concat.TextElement
sub element points to a file or contains text
|
description, location, project
Constructor and Description |
---|
Concat()
Construct a new Concat task.
|
Modifier and Type | Method and Description |
---|---|
void |
add(ResourceCollection c)
Add an arbitrary ResourceCollection.
|
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 footerToAdd)
Add a footer to the concatenated output
|
void |
addHeader(Concat.TextElement headerToAdd)
Add a header to the concatenated output
|
void |
addText(java.lang.String text)
This method adds text which appears in the 'concat' element.
|
Path |
createPath()
Path of files to concatenate.
|
void |
execute()
Execute the concat task.
|
boolean |
isFilesystemOnly()
Implement ResourceCollection.
|
java.util.Iterator<Resource> |
iterator()
Implement ResourceCollection.
|
void |
reset()
Reset state to default.
|
void |
setAppend(boolean append)
Sets the behavior when the destination exists.
|
void |
setBinary(boolean binary)
Set the binary attribute.
|
void |
setDest(Resource dest)
Set the resource to write to.
|
void |
setDestfile(java.io.File destinationFile)
Sets the destination file, or uses the console if not specified.
|
void |
setEncoding(java.lang.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 forceOverwrite)
Deprecated.
use #setOverwrite instead
|
void |
setForceReadOnly(boolean f)
Whether read-only destinations will be overwritten.
|
void |
setIgnoreEmpty(boolean ignoreEmpty)
Sets the behavior when no source resource files are available.
|
void |
setOutputEncoding(java.lang.String outputEncoding)
Sets the character encoding for outputting
|
void |
setOverwrite(boolean forceOverwrite)
Force overwrite existing destination file
|
void |
setResourceName(java.lang.String resourceName)
Set the name that will be reported by the exposed
Resource . |
void |
setWriter(java.io.Writer outputWriter)
Set the output writer.
|
int |
size()
Implement ResourceCollection.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
public void reset()
public void setDestfile(java.io.File destinationFile)
destinationFile
- the destination filepublic void setDest(Resource dest)
dest
- the Resource to write to.public void setAppend(boolean append)
true
the task will append the stream data an
Appendable
resource; otherwise existing content will be
overwritten. Defaults to false
.append
- if true append output.public void setEncoding(java.lang.String encoding)
encoding
- the encoding of the input stream and unless
outputencoding is set, the outputstream.public void setOutputEncoding(java.lang.String outputEncoding)
outputEncoding
- the encoding for the output filepublic void setForce(boolean forceOverwrite)
forceOverwrite
- if true always overwrite, otherwise only
overwrite if the output file is older any of the
input files.public void setOverwrite(boolean forceOverwrite)
forceOverwrite
- if true always overwrite, otherwise only
overwrite if the output file is older any of the
input files.public void setForceReadOnly(boolean f)
Defaults to false
f
- booleanpublic void setIgnoreEmpty(boolean ignoreEmpty)
false
the destination file will always be created.
Defaults to true
.ignoreEmpty
- if false honour destinationfile creation.public void setResourceName(java.lang.String resourceName)
Resource
.resourceName
- to setpublic Path createPath()
public void addFileset(FileSet set)
set
- the set of filespublic void addFilelist(FileList list)
list
- the list of filespublic void add(ResourceCollection c)
c
- the ResourceCollection to add.public void addFilterChain(FilterChain filterChain)
filterChain
- a filterchain to filter the concatenated inputpublic void addText(java.lang.String text)
text
- the text to be concated.public void addHeader(Concat.TextElement headerToAdd)
headerToAdd
- the headerpublic void addFooter(Concat.TextElement footerToAdd)
footerToAdd
- the footerpublic void setFixLastLine(boolean fixLastLine)
fixLastLine
- if true make sure each input file has
new line on the concatenated streampublic void setEol(FixCRLF.CrLf crlf)
crlf
- the type of new line to add -
cr, mac, lf, unix, crlf, or dospublic void setWriter(java.io.Writer outputWriter)
outputWriter
- the output writer.public void setBinary(boolean binary)
binary
- if true, enable binary mode.public java.util.Iterator<Resource> iterator()
iterator
in interface java.lang.Iterable<Resource>
iterator
in interface ResourceCollection
public int size()
size
in interface ResourceCollection
public boolean isFilesystemOnly()
isFilesystemOnly
in interface ResourceCollection