| Modifier and Type | Field and Description |
|---|---|
| private Map | dirEntries
record list of all directory zip entries |
| private String | encoding
encoding of file names. |
| private boolean | |
| private Map | fileEntries
record list of all file zip entries |
| private Resource | lastScannedResource
to record the last scanned zip file with its modification date |
| private Map | matchDirEntries
record list of matching directory zip entries |
| private Map | matchFileEntries
record list of matching file zip entries |
| private Resource | src
The archive resource which should be scanned. |
| protected File | srcFile
The archive file which should be scanned. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract void | fillMapsFromArchive(Resource
the archive to scan. archive, String encoding used to encode file names inside the archive. encoding, Map<String, Resource> Map (name to resource) of non-directory
resources found inside the archive. fileEntries, Map<String, Resource> Map (name to resource) of non-directory
resources found inside the archive that matched all include
patterns and didn't match any exclude patterns. matchFileEntries, Map<String, Resource> Map (name to resource) of directory
resources found inside the archive. dirEntries, Map<String, Resource> Map (name to resource) of directory
resources found inside the archive that matched all include
patterns and didn't match any exclude patterns. matchDirEntries)Fills the file and directory maps with resources read from the archive. |
| public String[] | Returns: the names of the directories which matched at least one of the include patterns and none of the exclude patterns.Overrides org. Implements org. |
| public int | Returns: count of included directories.Overrides org. |
| public String[] | Returns: the names of the files which matched at least one of the include patterns and none of the exclude patterns.Overrides org. Implements org. |
| public int | Returns: count of included files.Overrides org. |
| public Resource | Returns: the resourcepath name of the file sought in the archive name)Overrides org. Implements org. |
| pack-priv Iterator | Returns: an Iterator of Resources.since Ant 1.8 project)Get the set of Resources that represent directories. |
| pack-priv Iterator | Returns: an Iterator of Resources.since Ant 1.8 project)Get the set of Resources that represent files. |
| public void | |
| public boolean | |
| public void | scan()
Overrides org. Implements org. |
| private void | scanme()
if the datetime of the archive did not change since lastScannedResource was initialized returns immediately else if the archive has not been scanned yet, then all the zip entries are put into the appropriate tables. |
| public void | |
| public void | setErrorOnMissingArchive(boolean
true if missing archives cause errors,
false if not. errorOnMissingArchive)Sets whether an error is thrown if an archive does not exist. |
| public void | |
| public void | |
| protected static final String | Returns: the trimmed file name.the file name to trim. s)Remove trailing slash if present. |
| dirEntries | back to summary |
|---|---|
| private Map<String, Resource> dirEntries record list of all directory zip entries | |
| encoding | back to summary |
|---|---|
| private String encoding encoding of file names.
| |
| errorOnMissingArchive | back to summary |
|---|---|
private boolean errorOnMissingArchive
| |
| fileEntries | back to summary |
|---|---|
| private Map<String, Resource> fileEntries record list of all file zip entries | |
| lastScannedResource | back to summary |
|---|---|
| private Resource lastScannedResource to record the last scanned zip file with its modification date | |
| matchDirEntries | back to summary |
|---|---|
| private Map<String, Resource> matchDirEntries record list of matching directory zip entries | |
| matchFileEntries | back to summary |
|---|---|
| private Map<String, Resource> matchFileEntries record list of matching file zip entries | |
| src | back to summary |
|---|---|
| private Resource src The archive resource which should be scanned. | |
| srcFile | back to summary |
|---|---|
| protected File srcFile The archive file which should be scanned. | |
| ArchiveScanner | back to summary |
|---|---|
| public ArchiveScanner() | |
| fillMapsFromArchive | back to summary |
|---|---|
| protected abstract void fillMapsFromArchive(Resource archive, String encoding, Map<String, Resource> fileEntries, Map<String, Resource> matchFileEntries, Map<String, Resource> dirEntries, Map<String, Resource> matchDirEntries) Fills the file and directory maps with resources read from the archive.
| |
| getIncludedDirectories | back to summary |
|---|---|
| public String[] getIncludedDirectories() Overrides org. Implements org. Returns the names of the directories which matched at least one of the include patterns and none of the exclude patterns. The names are relative to the base directory.
| |
| getIncludedDirsCount | back to summary |
|---|---|
| public int getIncludedDirsCount() Overrides org. Override parent implementation.
| |
| getIncludedFiles | back to summary |
|---|---|
| public String[] getIncludedFiles() Overrides org. Implements org. Returns the names of the files which matched at least one of the include patterns and none of the exclude patterns. The names are relative to the base directory.
| |
| getIncludedFilesCount | back to summary |
|---|---|
| public int getIncludedFilesCount() Overrides org. Override parent implementation.
| |
| getResource | back to summary |
|---|---|
| public Resource getResource(String name) Overrides org. Implements org. Get the named Resource. | |
| getResourceDirectories | back to summary |
|---|---|
| pack-priv Iterator Get the set of Resources that represent directories. | |
| getResourceFiles | back to summary |
|---|---|
| pack-priv Iterator Get the set of Resources that represent files. | |
| init | back to summary |
|---|---|
| public void init() Initialize DirectoryScanner data structures. | |
| match | back to summary |
|---|---|
| public boolean match(String path) Matches a jar entry against the includes/excludes list, normalizing the path separator.
| |
| scan | back to summary |
|---|---|
| public void scan() Overrides org. Implements org. Don't scan when we have no zipfile.
| |
| scanme | back to summary |
|---|---|
| private void scanme() if the datetime of the archive did not change since lastScannedResource was initialized returns immediately else if the archive has not been scanned yet, then all the zip entries are put into the appropriate tables. | |
| setEncoding | back to summary |
|---|---|
| public void setEncoding(String encoding) Sets encoding of file names.
| |
| setErrorOnMissingArchive | back to summary |
|---|---|
| public void setErrorOnMissingArchive(boolean errorOnMissingArchive) Sets whether an error is thrown if an archive does not exist.
| |
| setSrc | back to summary |
|---|---|
| public void setSrc(File srcFile) Sets the srcFile for scanning. This is the jar or zip file that is scanned for matching entries.
| |
| setSrc | back to summary |
|---|---|
| public void setSrc(Resource src) Sets the src for scanning. This is the jar or zip file that is scanned for matching entries.
| |
| trimSeparator | back to summary |
|---|---|
| protected static final String trimSeparator(String s) Remove trailing slash if present. | |