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
|
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(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.
|
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(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 |
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(String outputEncoding)
Sets the character encoding for outputting
|
void |
setOverwrite(boolean forceOverwrite)
Force overwrite existing destination file
|
void |
setResourceName(String resourceName)
Set the name that will be reported by the exposed
Resource . |
void |
setWriter(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 add(ResourceCollection c)
c
- the ResourceCollection to add.public void addFilelist(FileList list)
list
- the list of filespublic void addFileset(FileSet set)
set
- the set of filespublic void addFilterChain(FilterChain filterChain)
filterChain
- a filterchain to filter the concatenated inputpublic void addFooter(Concat.TextElement footerToAdd)
footerToAdd
- the footerpublic void addHeader(Concat.TextElement headerToAdd)
headerToAdd
- the headerpublic void addText(String text)
text
- the text to be concated.public Path createPath()
public boolean isFilesystemOnly()
isFilesystemOnly
in interface ResourceCollection
public Iterator<Resource> iterator()
iterator
in interface Iterable<Resource>
iterator
in interface ResourceCollection
public void reset()
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 setBinary(boolean binary)
binary
- if true, enable binary mode.public void setDest(Resource dest)
dest
- the Resource to write to.public void setDestfile(File destinationFile)
destinationFile
- the destination filepublic void setEncoding(String encoding)
encoding
- the encoding of the input stream and unless
outputencoding is set, the outputstream.public void setEol(FixCRLF.CrLf crlf)
crlf
- the type of new line to add -
cr, mac, lf, unix, crlf, or dospublic void setFixLastLine(boolean fixLastLine)
fixLastLine
- if true make sure each input file has
new line on the concatenated streampublic void setForceReadOnly(boolean f)
Defaults to false
public void setIgnoreEmpty(boolean ignoreEmpty)
false
the destination file will always be created.
Defaults to true
.ignoreEmpty
- if false honour destinationfile creation.public void setOutputEncoding(String outputEncoding)
outputEncoding
- the encoding for the output filepublic 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 setResourceName(String resourceName)
Resource
.resourceName
- to setpublic void setWriter(Writer outputWriter)
outputWriter
- the output writer.public int size()
size
in interface ResourceCollection