<concat destfile="${build.dir}/index.xml" append="false"> <fileset dir="${xml.root.dir}" includes="*.xml" /> </concat>
Modifier and Type | Class and Description |
---|---|
private class | |
private class | Concat.LastLineFixingReader
This class reads a Reader and ensures it ends with the desired linebreak |
private class | |
private static interface | |
public static class | Concat.TextElement
sub element points to a file or contains text |
Modifier and Type | Field and Description |
---|---|
private boolean | append
Whether or not the stream should be appended if the destination file exists. |
private boolean | binary
Stores the binary attribute |
private static final int | |
private Resource | dest
The destination of the stream. |
private String | encoding
Stores the input file encoding. |
private String | eolString
endofline for fixlast line |
private static final ResourceSelector | |
private static final FileUtils | |
private boolean | filterBeforeConcat
Stores the filterBeforeConcat attribute |
private Vector | filterChains
for filtering the concatenated |
private boolean | fixLastLine
add missing line.separator to files |
private Concat. | footer
String to place at the start of the concatenated stream |
private boolean | force
overwrite read-only files |
private boolean | forceOverwrite
ignore dates on input files |
private Concat. | header
String to place at the end of the concatenated stream |
private Concat. | |
private boolean | ignoreEmpty
whether to not create dest if no source files are available |
private static final ResourceSelector | |
private String | outputEncoding
Stores the output file encoding. |
private Writer | outputWriter
outputwriter |
private Resources | rc
Stores a collection of file sets and/or file lists, used to select multiple files for concatenation. |
private String | resourceName
exposed resource name |
private Concat. | |
private StringBuffer | textBuffer
This buffer stores the text within the 'concat' element. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public void | |
public void | |
public void | |
public void | addFilterChain(FilterChain
a filterchain to filter the concatenated input filterChain)Adds a FilterChain. |
public void | |
public void | |
public void | |
public Path | |
public void | |
private Reader | |
private ResourceCollection | |
public boolean | Returns: false.Implements org. |
private boolean | |
public Iterator | Returns: Iterator<Resource>.Implements java. |
public void | |
private void | |
public void | |
public void | |
public void | |
public void | setDestfile(File
the destination file destinationFile)Sets the destination file, or uses the console if not specified. |
public void | setEncoding(String
the encoding of the input stream and unless
outputencoding is set, the outputstream. encoding)Sets the character encoding |
public void | |
public void | setFilterBeforeConcat(final boolean
if true, filter each input before concatenation filterBeforeConcat)Set the filterBeforeConcat attribute. |
public void | setFixLastLine(boolean
if true make sure each input file has
new line on the concatenated stream fixLastLine)Append line.separator to files that do not end with a line.separator, default false. |
public void | setForce(boolean
if true always overwrite, otherwise only
overwrite if the output file is older any of the
input files. forceOverwrite)
Deprecated
use #setOverwrite instead
Force overwrite existing destination file
|
public void | |
public void | setIgnoreEmpty(boolean
if false, honour destination file creation. ignoreEmpty)Sets the behavior when no source resource files are available. |
public void | setOutputEncoding(String
the encoding for the output file outputEncoding)Sets the character encoding for outputting |
public void | setOverwrite(boolean
if true always overwrite, otherwise only
overwrite if the output file is older any of the
input files. forceOverwrite)Force overwrite existing destination file |
public void | setResourceName(String
to set resourceName)Set the name that will be reported by the exposed |
public void | |
public int | Returns: 1.Implements org. |
private void |
append | back to summary |
---|---|
private boolean append Whether or not the stream should be appended if the destination file
exists.
Defaults to |
binary | back to summary |
---|---|
private boolean binary Stores the binary attribute |
BUFFER_SIZE | back to summary |
---|---|
private static final int BUFFER_SIZE |
dest | back to summary |
---|---|
private Resource dest The destination of the stream. If |
encoding | back to summary |
---|---|
private String encoding Stores the input file encoding. |
eolString | back to summary |
---|---|
private String eolString endofline for fixlast line |
EXISTS | back to summary |
---|---|
private static final ResourceSelector EXISTS |
FILE_UTILS | back to summary |
---|---|
private static final FileUtils FILE_UTILS |
filterBeforeConcat | back to summary |
---|---|
private boolean filterBeforeConcat Stores the filterBeforeConcat attribute |
filterChains | back to summary |
---|---|
private Vector<FilterChain> filterChains for filtering the concatenated |
fixLastLine | back to summary |
---|---|
private boolean fixLastLine add missing line.separator to files |
footer | back to summary |
---|---|
private Concat. String to place at the start of the concatenated stream |
force | back to summary |
---|---|
private boolean force overwrite read-only files |
forceOverwrite | back to summary |
---|---|
private boolean forceOverwrite ignore dates on input files |
header | back to summary |
---|---|
private Concat. String to place at the end of the concatenated stream |
identityReaderFactory | back to summary |
---|---|
private Concat. |
ignoreEmpty | back to summary |
---|---|
private boolean ignoreEmpty whether to not create dest if no source files are available |
NOT_EXISTS | back to summary |
---|---|
private static final ResourceSelector NOT_EXISTS |
outputEncoding | back to summary |
---|---|
private String outputEncoding Stores the output file encoding. |
outputWriter | back to summary |
---|---|
private Writer outputWriter outputwriter |
rc | back to summary |
---|---|
private Resources rc Stores a collection of file sets and/or file lists, used to select multiple files for concatenation. |
resourceName | back to summary |
---|---|
private String resourceName exposed resource name |
resourceReaderFactory | back to summary |
---|---|
private Concat. |
textBuffer | back to summary |
---|---|
private StringBuffer textBuffer This buffer stores the text within the 'concat' element. |
Concat | back to summary |
---|---|
public Concat() Construct a new Concat task. |
add | back to summary |
---|---|
public void add(ResourceCollection c) Add an arbitrary ResourceCollection.
|
addFilelist | back to summary |
---|---|
public void addFilelist(FileList list) List of files to concatenate.
|
addFileset | back to summary |
---|---|
public void addFileset(FileSet set) Set of files to concatenate.
|
addFilterChain | back to summary |
---|---|
public void addFilterChain(FilterChain filterChain) Adds a FilterChain.
|
addFooter | back to summary |
---|---|
public void addFooter(Concat. Add a footer to the concatenated output
|
addHeader | back to summary |
---|---|
public void addHeader(Concat. Add a header to the concatenated output
|
addText | back to summary |
---|---|
public void addText(String text) This method adds text which appears in the 'concat' element.
|
createPath | back to summary |
---|---|
public Path createPath() Path of files to concatenate.
|
execute | back to summary |
---|---|
public void execute() Overrides org. Execute the concat task.
|
getFilteredReader | back to summary |
---|---|
private Reader getFilteredReader(Reader r) |
getResources | back to summary |
---|---|
private ResourceCollection getResources() Get the resources to concatenate. |
isFilesystemOnly | back to summary |
---|---|
public boolean isFilesystemOnly() Implements org. Implement ResourceCollection.
|
isUpToDate | back to summary |
---|---|
private boolean isUpToDate(ResourceCollection c) |
iterator | back to summary |
---|---|
public Iterator Implements java. Implement ResourceCollection. |
reset | back to summary |
---|---|
public void reset() Reset state to default. |
sanitizeText | back to summary |
---|---|
private void sanitizeText() Treat empty nested text as no text. Depending on the XML parser, addText may have been called for "ignorable whitespace" as well. |
setAppend | back to summary |
---|---|
public void setAppend(boolean append) Sets the behavior when the destination exists. If set to
|
setBinary | back to summary |
---|---|
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.
|
setDest | back to summary |
---|---|
public void setDest(Resource dest) Set the resource to write to.
|
setDestfile | back to summary |
---|---|
public void setDestfile(File destinationFile) Sets the destination file, or uses the console if not specified.
|
setEncoding | back to summary |
---|---|
public void setEncoding(String encoding) Sets the character encoding
|
setEol | back to summary |
---|---|
public void setEol(FixCRLF. 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. |
setFilterBeforeConcat | back to summary |
---|---|
public void setFilterBeforeConcat(final boolean filterBeforeConcat) Set the filterBeforeConcat attribute. If true, concat will filter each input through the filterchain before concatenating the results. This allows to e.g. use the FileTokenizer to tokenize each input.
|
setFixLastLine | back to summary |
---|---|
public void setFixLastLine(boolean fixLastLine) Append line.separator to files that do not end with a line.separator, default false.
|
setForce | back to summary |
---|---|
public void setForce(boolean forceOverwrite)
Deprecated use #setOverwrite instead Force overwrite existing destination file
|
setForceReadOnly | back to summary |
---|---|
public void setForceReadOnly(boolean f) Whether read-only destinations will be overwritten. Defaults to false
|
setIgnoreEmpty | back to summary |
---|---|
public void setIgnoreEmpty(boolean ignoreEmpty) Sets the behavior when no source resource files are available. If set to
|
setOutputEncoding | back to summary |
---|---|
public void setOutputEncoding(String outputEncoding) Sets the character encoding for outputting
|
setOverwrite | back to summary |
---|---|
public void setOverwrite(boolean forceOverwrite) Force overwrite existing destination file
|
setResourceName | back to summary |
---|---|
public void setResourceName(String resourceName) Set the name that will be reported by the exposed
|
setWriter | back to summary |
---|---|
public void setWriter(Writer outputWriter) Set the output writer. This is to allow concat to be used as a nested element.
|
size | back to summary |
---|---|
public int size() Implements org. Implement ResourceCollection.
|
validate | back to summary |
---|---|
private void validate() Validate configuration options. |
Modifier and Type | Field and Description |
---|---|
private ResourceCollection |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public InputStream | getInputStream()
Overrides org. |
public String | getName()
Overrides org. |
c | back to summary |
---|---|
private ResourceCollection c |
ConcatResource | back to summary |
---|---|
private ConcatResource(ResourceCollection c) |
getInputStream | back to summary |
---|---|
public InputStream getInputStream() Overrides org. Doc from org. Get an InputStream for the Resource.
|
getName | back to summary |
---|---|
public String getName() Overrides org. Doc from org. Name attribute will contain the path of a file relative to the root directory of its fileset or the recorded path of a zip entry. example for a file with fullpath /var/opt/adm/resource.txt in a file set with root dir /var/opt it will be adm/resource.txt. "/" will be used as the directory separator. |
Modifier and Type | Field and Description |
---|---|
private final char[] | |
private int | |
private boolean | |
private final Reader |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
private void | addLastChar(char ch)
if checking for end of line at end of file add a character to the lastchars buffer |
public void | close()
Implements abstract java. Implements java. |
private boolean | |
public int | Returns: the character read, -1 for EOF on the last reader.Overrides java. |
public int | read(char[]
The array to be read into. cbuf, int The offset. off, int The length to read. len)Implements abstract java. cbuf .
|
lastChars | back to summary |
---|---|
private final char[] lastChars |
lastPos | back to summary |
---|---|
private int lastPos |
needAddSeparator | back to summary |
---|---|
private boolean needAddSeparator |
reader | back to summary |
---|---|
private final Reader reader |
LastLineFixingReader | back to summary |
---|---|
private LastLineFixingReader(Reader reader) |
addLastChar | back to summary |
---|---|
private void addLastChar(char ch) if checking for end of line at end of file add a character to the lastchars buffer |
close | back to summary |
---|---|
public void close() throws IOException Implements abstract java. Implements java. Close the current reader
|
isMissingEndOfLine | back to summary |
---|---|
private boolean isMissingEndOfLine() return true if the lastchars buffer does not contain the line separator |
read | back to summary |
---|---|
public int read() throws IOException Overrides java. Read a character from the current reader object. Advance to the next if the reader is finished.
|
read | back to summary |
---|---|
public int read(char[] cbuf, int off, int len) throws IOException Implements abstract java. Read into the buffer
|
Modifier and Type | Field and Description |
---|---|
private Concat. | |
private final boolean | |
private Reader | |
private Iterator |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public void | close()
Implements abstract java. Implements java. |
private Reader | |
private boolean | |
private void | |
public int | Returns: the character read, -1 for EOF on the last reader.Overrides java. |
public int | read(char[]
The array to be read into. cbuf, int The offset. off, int The length to read. len)Implements abstract java. cbuf .
|
factory | back to summary |
---|---|
private Concat. |
filterBeforeConcat | back to summary |
---|---|
private final boolean filterBeforeConcat |
reader | back to summary |
---|---|
private Reader reader |
readerSources | back to summary |
---|---|
private Iterator<S> readerSources |
MultiReader | back to summary |
---|---|
private MultiReader(Iterator<S> readerSources, Concat. |
close | back to summary |
---|---|
public void close() throws IOException Implements abstract java. Implements java. Close the current reader
|
getReader | back to summary |
---|---|
private Reader getReader() throws IOException |
isFixLastLine | back to summary |
---|---|
private boolean isFixLastLine() |
nextReader | back to summary |
---|---|
private void nextReader() throws IOException |
read | back to summary |
---|---|
public int read() throws IOException Overrides java. Read a character from the current reader object. Advance to the next if the reader is finished.
|
read | back to summary |
---|---|
public int read(char[] cbuf, int off, int len) throws IOException Implements abstract java. Read into the buffer
|
getReader | back to summary |
---|---|
public Reader getReader(S s) throws IOException |
Modifier and Type | Field and Description |
---|---|
private String | |
private boolean | |
private boolean | |
private boolean | |
private String |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public void | |
private boolean | |
public String | |
public void | |
public void | |
public void | setFiltering(boolean
true if the text should be filtered.
the default value is true. filtering)whether to filter the text in this element or not. |
public void | |
public void |
encoding | back to summary |
---|---|
private String encoding |
filtering | back to summary |
---|---|
private boolean filtering |
trim | back to summary |
---|---|
private boolean trim |
trimLeading | back to summary |
---|---|
private boolean trimLeading |
value | back to summary |
---|---|
private String value |
TextElement | back to summary |
---|---|
public TextElement() |
addText | back to summary |
---|---|
public void addText(String value) set the text using inline
|
getFiltering | back to summary |
---|---|
private boolean getFiltering() return the filtering attribute |
getValue | back to summary |
---|---|
public String getValue()
|
setEncoding | back to summary |
---|---|
public void setEncoding(String encoding) The encoding of the text element
|
setFile | back to summary |
---|---|
public void setFile(File file) throws BuildException set the text using a file
|
setFiltering | back to summary |
---|---|
public void setFiltering(boolean filtering) whether to filter the text in this element or not.
|
setTrim | back to summary |
---|---|
public void setTrim(boolean trim) whether to call text.trim()
|
setTrimLeading | back to summary |
---|---|
public void setTrimLeading(boolean strip) s:^\s*:: on each line of input
|