FileScanner, ResourceFactory, SelectorScannerTarScanner, ZipScannerpublic abstract class ArchiveScanner extends DirectoryScanner
| Modifier and Type | Field | Description |
|---|---|---|
protected java.io.File |
srcFile |
The archive file which should be scanned.
|
basedir, DEFAULTEXCLUDES, dirsDeselected, dirsExcluded, dirsIncluded, dirsNotIncluded, DOES_NOT_EXIST_POSTFIX, errorOnMissingDir, everythingIncluded, excludes, filesDeselected, filesExcluded, filesIncluded, filesNotIncluded, haveSlowResults, includes, isCaseSensitive, MAX_LEVELS_OF_SYMLINKS, selectors| Constructor | Description |
|---|---|
ArchiveScanner() |
| Modifier and Type | Method | Description |
|---|---|---|
protected abstract void |
fillMapsFromArchive(Resource archive,
java.lang.String encoding,
java.util.Map<java.lang.String,Resource> fileEntries,
java.util.Map<java.lang.String,Resource> matchFileEntries,
java.util.Map<java.lang.String,Resource> dirEntries,
java.util.Map<java.lang.String,Resource> matchDirEntries) |
Fills the file and directory maps with resources read from the archive.
|
java.lang.String[] |
getIncludedDirectories() |
Returns the names of the directories which matched at least one of the
include patterns and none of the exclude patterns.
|
int |
getIncludedDirsCount() |
Override parent implementation.
|
java.lang.String[] |
getIncludedFiles() |
Returns the names of the files which matched at least one of the
include patterns and none of the exclude patterns.
|
int |
getIncludedFilesCount() |
Override parent implementation.
|
Resource |
getResource(java.lang.String name) |
Get the named Resource.
|
void |
init() |
Initialize DirectoryScanner data structures.
|
boolean |
match(java.lang.String path) |
Matches a jar entry against the includes/excludes list,
normalizing the path separator.
|
void |
scan() |
Don't scan when we have no zipfile.
|
void |
setEncoding(java.lang.String encoding) |
Sets encoding of file names.
|
void |
setErrorOnMissingArchive(boolean errorOnMissingArchive) |
Sets whether an error is thrown if an archive does not exist.
|
void |
setSrc(java.io.File srcFile) |
Sets the srcFile for scanning.
|
void |
setSrc(Resource src) |
Sets the src for scanning.
|
protected static java.lang.String |
trimSeparator(java.lang.String s) |
Remove trailing slash if present.
|
addDefaultExclude, addDefaultExcludes, addExcludes, clearResults, couldHoldIncluded, getBasedir, getDefaultExcludes, getDeselectedDirectories, getDeselectedFiles, getExcludedDirectories, getExcludedFiles, getNotFollowedSymlinks, getNotIncludedDirectories, getNotIncludedFiles, isCaseSensitive, isEverythingIncluded, isExcluded, isFollowSymlinks, isIncluded, isSelected, match, match, matchPath, matchPath, matchPatternStart, matchPatternStart, removeDefaultExclude, resetDefaultExcludes, scandir, setBasedir, setBasedir, setCaseSensitive, setErrorOnMissingDir, setExcludes, setFollowSymlinks, setIncludes, setMaxLevelsOfSymlinks, setSelectors, slowScanpublic void setErrorOnMissingArchive(boolean errorOnMissingArchive)
errorOnMissingArchive - true if missing archives cause errors,
false if not.public void scan()
scan in interface FileScannerscan in class DirectoryScannerpublic void setSrc(java.io.File srcFile)
srcFile - the (non-null) archive file name for scanningpublic void setSrc(Resource src)
src - the (non-null) archive resourcepublic void setEncoding(java.lang.String encoding)
encoding - the encoding formatpublic java.lang.String[] getIncludedFiles()
getIncludedFiles in interface FileScannergetIncludedFiles in class DirectoryScannerpublic int getIncludedFilesCount()
getIncludedFilesCount in class DirectoryScannerpublic java.lang.String[] getIncludedDirectories()
getIncludedDirectories in interface FileScannergetIncludedDirectories in class DirectoryScannerpublic int getIncludedDirsCount()
getIncludedDirsCount in class DirectoryScannerpublic void init()
public boolean match(java.lang.String path)
path - the (non-null) path name to test for inclusiontrue if the path should be included
false otherwise.public Resource getResource(java.lang.String name)
getResource in interface ResourceFactorygetResource in class DirectoryScannername - path name of the file sought in the archiveprotected abstract void fillMapsFromArchive(Resource archive, java.lang.String encoding, java.util.Map<java.lang.String,Resource> fileEntries, java.util.Map<java.lang.String,Resource> matchFileEntries, java.util.Map<java.lang.String,Resource> dirEntries, java.util.Map<java.lang.String,Resource> matchDirEntries)
archive - the archive to scan.encoding - encoding used to encode file names inside the archive.fileEntries - Map (name to resource) of non-directory
resources found inside the archive.matchFileEntries - Map (name to resource) of non-directory
resources found inside the archive that matched all include
patterns and didn't match any exclude patterns.dirEntries - Map (name to resource) of directory
resources found inside the archive.matchDirEntries - Map (name to resource) of directory
resources found inside the archive that matched all include
patterns and didn't match any exclude patterns.protected static final java.lang.String trimSeparator(java.lang.String s)
s - the file name to trim.