|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.Task org.apache.tools.ant.taskdefs.Concat
public 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>
Nested Class Summary | |
---|---|
static class |
Concat.TextElement
sub element points to a file or contains text |
Field Summary |
---|
Fields inherited from class org.apache.tools.ant.Task |
---|
target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
description, location, project |
Constructor Summary | |
---|---|
Concat()
Construct a new Concat task. |
Method Summary | |
---|---|
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. |
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(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 force)
Force overwrite existing destination file |
void |
setOutputEncoding(java.lang.String outputEncoding)
Sets the character encoding for outputting |
void |
setWriter(java.io.Writer outputWriter)
Set the output writer. |
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Concat()
Method Detail |
---|
public void reset()
public void setDestfile(java.io.File destinationFile)
destinationFile
- the destination filepublic void setAppend(boolean append)
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.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 force)
force
- if true always overwrite, otherwise only overwrite
if the output file is older any of the input files.public 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 void execute()
execute
in class Task
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |