| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static interface |
| Modifier and Type | Field and Description |
|---|---|
| private static final FileUtils | FILE_UTILS
Utilities used for file operations |
| public static final String | ISO_8859_1
Name of charset "ISO Latin Alphabet No. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | |
| public static FileResource | Returns: fileProvider if it is a FileResource instance, or a new FileResource with fileProvider's file.input fileProvider)Convenience method to turn any fileProvider into a basic FileResource with the file's immediate parent as the basedir, for tasks that need one. |
| private static int | Returns: a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.the Resource whose content is to be compared. r1, final Resource the other Resource whose content is to be compared. r2)Binary compares the contents of two Resources. |
| private static Charset | |
| public static int | Returns: a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.the Resource whose content is to be compared. r1, final Resource the other Resource whose content is to be compared. r2, final boolean true if the content is to be treated as text and
differences in kind of line break are to be ignored. text)Compare the content of two Resources. |
| public static boolean | Returns: true if the content of the Resources is the same.the Resource whose content is to be compared. r1, final Resource the other Resource whose content is to be compared. r2, final boolean true if the content is to be treated as text and
differences in kind of line break are to be ignored. text)Compares the contents of two Resources. |
| public static void | copyResource(final Resource
the Resource to copy from.
Must not be source, final Resource null.the Resource to copy to.
Must not be dest)null.Convenience method to copy content from one Resource to another. |
| public static void | copyResource(final Resource
the Resource to copy from.
Must not be source, final Resource null.the Resource to copy to.
Must not be dest, final Project null.the project instance. project)Convenience method to copy content from one Resource to another. |
| public static void | copyResource(final Resource
the Resource to copy from.
Must not be source, final Resource null.the Resource to copy to.
Must not be dest, final FilterSetCollection null.the collection of filters to apply to this copy. filters, final Vector<FilterChain> filterChains to apply during the copy. filterChains, final boolean Whether or not the destination Resource should be
overwritten if it already exists. overwrite, final boolean Whether or not the last modified time of
the destination Resource should be set to that
of the source. preserveLastModified, final String the encoding used to read the files. inputEncoding, final String the encoding used to write the files. outputEncoding, final Project the project instance. project)Convenience method to copy content from one Resource to another
specifying whether token filtering must be used, whether filter chains
must be used, whether newer destination files may be overwritten and
whether the last modified time of |
| public static void | copyResource(final Resource
the Resource to copy from.
Must not be source, final Resource null.the Resource to copy to.
Must not be dest, final FilterSetCollection null.the collection of filters to apply to this copy. filters, final Vector<FilterChain> filterChains to apply during the copy. filterChains, final boolean Whether or not the destination Resource should be
overwritten if it already exists. overwrite, final boolean Whether or not the last modified time of
the destination Resource should be set to that
of the source. preserveLastModified, final boolean Whether to append to an Appendable Resource. append, final String the encoding used to read the files. inputEncoding, final String the encoding used to write the files. outputEncoding, final Project the project instance. project)Convenience method to copy content from one Resource to another
specifying whether token filtering must be used, whether filter chains
must be used, whether newer destination files may be overwritten and
whether the last modified time of |
| public static void | copyResource(final Resource
the Resource to copy from.
Must not be source, final Resource null.the Resource to copy to.
Must not be dest, final FilterSetCollection null.the collection of filters to apply to this copy. filters, final Vector<FilterChain> filterChains to apply during the copy. filterChains, final boolean Whether or not the destination Resource should be
overwritten if it already exists. overwrite, final boolean Whether or not the last modified time of
the destination Resource should be set to that
of the source. preserveLastModified, final boolean Whether to append to an Appendable Resource. append, final String the encoding used to read the files. inputEncoding, final String the encoding used to write the files. outputEncoding, final Project the project instance. project, final boolean whether read-only target files will be overwritten force)Convenience method to copy content from one Resource to another
specifying whether token filtering must be used, whether filter chains
must be used, whether newer destination files may be overwritten and
whether the last modified time of |
| private static void | |
| private static void | copyUsingStreams(final Resource source, final Resource dest, final boolean append, final Project project)
|
| private static void | copyWithFilterChainsOrTranscoding(final Resource source, final Resource dest, final Vector<FilterChain> filterChains, final boolean append, final String inputEncoding, final String outputEncoding, final Project project)
|
| private static void | copyWithFilterSets(final Resource source, final Resource dest, final FilterSetCollection filters, final Vector<FilterChain> filterChains, final boolean append, final String inputEncoding, final String outputEncoding, final Project project)
|
| private static Reader | |
| private static OutputStream | |
| private static void | |
| private static void | |
| private static void | logFuture(final ProjectComponent
the ProjectComponent to do the logging. logTo, final ResourceCollection the collection of Resources to check. rc, final long the timestamp granularity to use. granularity)Log which Resources (if any) have been modified in the future. |
| public static Resource[] | Returns: array containing the source files which need to be copied or processed, because the targets are out of date or do not exist.where to send (more or less) interesting output. logTo, final Resource[] array of resources bearing relative path and last
modification date. source, final FileNameMapper filename mapper indicating how to find the target
files. mapper, final ResourceFactory object able to map as a resource a relative path
at destination. targets)Tells which source files should be reprocessed based on the last modification date of target files. |
| public static Resource[] | Returns: array containing the source files which need to be copied or processed, because the targets are out of date or do not exist.where to send (more or less) interesting output. logTo, final Resource[] array of resources bearing relative path and last
modification date. source, final FileNameMapper filename mapper indicating how to find the target
files. mapper, final ResourceFactory object able to map as a resource a relative path
at destination. targets, final long The number of milliseconds leeway to give
before deciding a target is out of date. granularity)Tells which source files should be reprocessed based on the last modification date of target files. |
| public static ResourceCollection | Returns: ResourceCollection.where to send (more or less) interesting output. logTo, final ResourceCollection ResourceCollection. source, final FileNameMapper filename mapper indicating how to find the target Resources. mapper, final ResourceFactory object able to map a relative path as a Resource. targets, final long The number of milliseconds leeway to give
before deciding a target is out of date. granularity)Tells which sources should be reprocessed based on the last modification date of targets. |
| public static ResourceCollection | Returns: ResourceCollection.where to send (more or less) interesting output. logTo, ResourceCollection ResourceCollection. source, final FileNameMapper filename mapper indicating how to find the target Resources. mapper, final ResourceFactory object able to map a relative path as a Resource. targets, final ResourceUtils.returns a selector that is applied to target
files. If it selects at least one target the source will be
added to the returned collection. selectorTells which sources should be reprocessed because the given selector selects at least one target. |
| public static void | setLastModified(final Touchable
the Touchable whose modified time is to be set. t, final long the time to which the last modified time is to be set.
if this is -1, the current time is used. time)Set the last modified time of an object implementing org.apache.tools.ant.types.resources.Touchable . |
| private static int | Returns: a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.the Resource whose content is to be compared. r1, final Resource the other Resource whose content is to be compared. r2)Text compares the contents of two Resources. |
| FILE_UTILS | back to summary |
|---|---|
| private static final FileUtils FILE_UTILS Utilities used for file operations | |
| ISO_8859_1 | back to summary |
|---|---|
| public static final String ISO_8859_1
Deprecated use StandardCharsets.ISO_8859_1 Name of charset "ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1".
| |
| MAX_IO_CHUNK_SIZE | back to summary |
|---|---|
| private static final long MAX_IO_CHUNK_SIZE | |
| ResourceUtils | back to summary |
|---|---|
| public ResourceUtils() | |
| areSame | back to summary |
|---|---|
| private static boolean areSame(final Resource resource1, final Resource resource2) throws IOException | |
| asFileResource | back to summary |
|---|---|
| public static FileResource asFileResource(final FileProvider fileProvider) Convenience method to turn any fileProvider into a basic FileResource with the file's immediate parent as the basedir, for tasks that need one.
| |
| binaryCompare | back to summary |
|---|---|
| private static int binaryCompare(final Resource r1, final Resource r2) throws IOException Binary compares the contents of two Resources. simple but sub-optimal comparison algorithm. written for working rather than fast. Better would be a block read into buffers followed by long comparisons apart from the final 1-7 bytes.
| |
| charsetFor | back to summary |
|---|---|
| private static Charset charsetFor(String encoding) | |
| compareContent | back to summary |
|---|---|
| public static int compareContent(final Resource r1, final Resource r2, final boolean text) throws IOException Compare the content of two Resources. A nonexistent Resource's content is "less than" that of an existing Resource; a directory-type Resource's content is "less than" that of a file-type Resource.
| |
| contentEquals | back to summary |
|---|---|
| public static boolean contentEquals(final Resource r1, final Resource r2, final boolean text) throws IOException Compares the contents of two Resources.
| |
| copyResource | back to summary |
|---|---|
| public static void copyResource(final Resource source, final Resource dest) throws IOException Convenience method to copy content from one Resource to another. No filtering is performed.
| |
| copyResource | back to summary |
|---|---|
| public static void copyResource(final Resource source, final Resource dest, final Project project) throws IOException Convenience method to copy content from one Resource to another. No filtering is performed.
| |
| copyResource | back to summary |
|---|---|
| public static void copyResource(final Resource source, final Resource dest, final FilterSetCollection filters, final Vector<FilterChain> filterChains, final boolean overwrite, final boolean preserveLastModified, final String inputEncoding, final String outputEncoding, final Project project) throws IOException Convenience method to copy content from one Resource to another
specifying whether token filtering must be used, whether filter chains
must be used, whether newer destination files may be overwritten and
whether the last modified time of
| |
| copyResource | back to summary |
|---|---|
| public static void copyResource(final Resource source, final Resource dest, final FilterSetCollection filters, final Vector<FilterChain> filterChains, final boolean overwrite, final boolean preserveLastModified, final boolean append, final String inputEncoding, final String outputEncoding, final Project project) throws IOException Convenience method to copy content from one Resource to another
specifying whether token filtering must be used, whether filter chains
must be used, whether newer destination files may be overwritten and
whether the last modified time of
| |
| copyResource | back to summary |
|---|---|
| public static void copyResource(final Resource source, final Resource dest, final FilterSetCollection filters, final Vector<FilterChain> filterChains, final boolean overwrite, final boolean preserveLastModified, final boolean append, final String inputEncoding, final String outputEncoding, final Project project, final boolean force) throws IOException Convenience method to copy content from one Resource to another
specifying whether token filtering must be used, whether filter chains
must be used, whether newer destination files may be overwritten and
whether the last modified time of
| |
| copyUsingFileChannels | back to summary |
|---|---|
| private static void copyUsingFileChannels(final File sourceFile, final File destFile, final Project project) throws IOException | |
| copyUsingStreams | back to summary |
|---|---|
| private static void copyUsingStreams(final Resource source, final Resource dest, final boolean append, final Project project) throws IOException | |
| copyWithFilterChainsOrTranscoding | back to summary |
|---|---|
| private static void copyWithFilterChainsOrTranscoding(final Resource source, final Resource dest, final Vector<FilterChain> filterChains, final boolean append, final String inputEncoding, final String outputEncoding, final Project project) throws IOException | |
| copyWithFilterSets | back to summary |
|---|---|
| private static void copyWithFilterSets(final Resource source, final Resource dest, final FilterSetCollection filters, final Vector<FilterChain> filterChains, final boolean append, final String inputEncoding, final String outputEncoding, final Project project) throws IOException | |
| filterWith | back to summary |
|---|---|
| private static Reader filterWith(Project project, String encoding, Vector<FilterChain> filterChains, InputStream input) | |
| getOutputStream | back to summary |
|---|---|
| private static OutputStream getOutputStream(final Resource resource, final boolean append, final Project project) throws IOException | |
| log | back to summary |
|---|---|
| private static void log(final Project project, final String message) | |
| log | back to summary |
|---|---|
| private static void log(final Project project, final String message, final int level) | |
| logFuture | back to summary |
|---|---|
| private static void logFuture(final ProjectComponent logTo, final ResourceCollection rc, final long granularity) Log which Resources (if any) have been modified in the future.
| |
| selectOutOfDateSources | back to summary |
|---|---|
| public static Resource[] selectOutOfDateSources(final ProjectComponent logTo, final Resource[] source, final FileNameMapper mapper, final ResourceFactory targets) Tells which source files should be reprocessed based on the last modification date of target files.
| |
| selectOutOfDateSources | back to summary |
|---|---|
| public static Resource[] selectOutOfDateSources(final ProjectComponent logTo, final Resource[] source, final FileNameMapper mapper, final ResourceFactory targets, final long granularity) Tells which source files should be reprocessed based on the last modification date of target files.
| |
| selectOutOfDateSources | back to summary |
|---|---|
| public static ResourceCollection selectOutOfDateSources(final ProjectComponent logTo, final ResourceCollection source, final FileNameMapper mapper, final ResourceFactory targets, final long granularity) Tells which sources should be reprocessed based on the last modification date of targets.
| |
| selectSources | back to summary |
|---|---|
| public static ResourceCollection selectSources(final ProjectComponent logTo, ResourceCollection source, final FileNameMapper mapper, final ResourceFactory targets, final ResourceUtils. Tells which sources should be reprocessed because the given selector selects at least one target.
| |
| setLastModified | back to summary |
|---|---|
| public static void setLastModified(final Touchable t, final long time) Set the last modified time of an object implementing org.apache.tools.ant.types.resources.Touchable .
| |
| textCompare | back to summary |
|---|---|
| private static int textCompare(final Resource r1, final Resource r2) throws IOException Text compares the contents of two Resources. Ignores different kinds of line endings.
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| ReadOnlyTargetFileException | back to summary |
|---|---|
| public ReadOnlyTargetFileException(final File destFile) | |
| Modifier and Type | Method and Description |
|---|---|
| public ResourceSelector |
| getTargetSelectorForSource | back to summary |
|---|---|
| public ResourceSelector getTargetSelectorForSource(Resource source) | |