Class AbstractScanner
- All Implemented Interfaces:
- Scanner
- Direct Known Subclasses:
- DirectoryScanner
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final String[]Patterns which should be excluded by default, like SCM files Misc: **/*~, **/#*#, **/.#*, **/%*%, **/._* CVS: **/CVS, **/CVS/**, **/.cvsignore RCS: **/RCS, **/RCS/** SCCS: **/SCCS, **/SCCS/** VSSercer: **/vssver.scc MKS: **/project.pj SVN: **/.svn, **/.svn/** GNU: **/.arch-ids, **/.arch-ids/** Bazaar: **/.bzr, **/.bzr/** SurroundSCM: **/.MySCMServerInfo Mac: **/.DS_Store Serena Dimension: **/.metadata, **/.metadata/** Mercurial: **/.hg, **/.hg/** Git: **/.git, **/.git/** Bitkeeper: **/BitKeeper, **/BitKeeper/**, **/ChangeSet, **/ChangeSet/** Darcs: **/_darcs, **/_darcs/**, **/.darcsrepo, **/.darcsrepo/****/-darcs-backup*, **/.darcs-temp-mailprotected String[]The patterns for the files to be excluded.protected Comparator<String>protected String[]The patterns for the files to be included.protected booleanWhether or not the file system should be treated as a case sensitive one.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds default exclusions to the current exclusions set.protected booleancouldHoldIncluded(String name) Tests whether or not a name matches the start of at least one include pattern.protected booleanisExcluded(String name) Tests whether or not a name matches against at least one exclude pattern.protected booleanisExcluded(String name, char[][] tokenizedName) protected booleanisExcluded(String name, String[] tokenizedName) protected booleanisIncluded(String name) Tests whether or not a name matches against at least one include pattern.protected booleanisIncluded(String name, char[][] tokenizedName) protected booleanisIncluded(String name, String[] tokenizedName) static booleanTests whether or not a string matches against a pattern.protected static booleanTests whether or not a string matches against a pattern.protected static booleanTests whether or not a given path matches a given pattern.protected static booleanTests whether or not a given path matches a given pattern.protected static booleanmatchPatternStart(String pattern, String str) Tests whether or not a given path matches the start of a given pattern up to the first "**".protected static booleanmatchPatternStart(String pattern, String str, boolean isCaseSensitive) Tests whether or not a given path matches the start of a given pattern up to the first "**".voidsetCaseSensitive(boolean isCaseSensitive) Sets whether or not the file system should be regarded as case sensitive.voidsetExcludes(String[] excludes) Sets the list of exclude patterns to use.voidsetFilenameComparator(Comparator<String> filenameComparator) Use a filename comparator in each directory when scanning.voidsetIncludes(String[] includes) Sets the list of include patterns to use.protected voidprotected voidMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.codehaus.plexus.util.ScannergetBasedir, getIncludedDirectories, getIncludedFiles, scan
- 
Field Details- 
DEFAULTEXCLUDESPatterns which should be excluded by default, like SCM files- Misc: **/*~, **/#*#, **/.#*, **/%*%, **/._*
- CVS: **/CVS, **/CVS/**, **/.cvsignore
- RCS: **/RCS, **/RCS/**
- SCCS: **/SCCS, **/SCCS/**
- VSSercer: **/vssver.scc
- MKS: **/project.pj
- SVN: **/.svn, **/.svn/**
- GNU: **/.arch-ids, **/.arch-ids/**
- Bazaar: **/.bzr, **/.bzr/**
- SurroundSCM: **/.MySCMServerInfo
- Mac: **/.DS_Store
- Serena Dimension: **/.metadata, **/.metadata/**
- Mercurial: **/.hg, **/.hg/**
- Git: **/.git, **/.git/**
- Bitkeeper: **/BitKeeper, **/BitKeeper/**, **/ChangeSet, **/ChangeSet/**
- Darcs: **/_darcs, **/_darcs/**, **/.darcsrepo, **/.darcsrepo/****/-darcs-backup*, **/.darcs-temp-mail
 - See Also:
 
- 
includesThe patterns for the files to be included.
- 
excludesThe patterns for the files to be excluded.
- 
isCaseSensitiveprotected boolean isCaseSensitiveWhether or not the file system should be treated as a case sensitive one.
- 
filenameComparator- Since:
- 3.3.0
 
 
- 
- 
Constructor Details- 
AbstractScannerpublic AbstractScanner()
 
- 
- 
Method Details- 
setCaseSensitivepublic void setCaseSensitive(boolean isCaseSensitive) Sets whether or not the file system should be regarded as case sensitive.- Parameters:
- isCaseSensitive- whether or not the file system should be regarded as a case sensitive one
 
- 
matchPatternStartTests whether or not a given path matches the start of a given pattern up to the first "**". This is not a general purpose test and should only be used if you can live with false positives. For example, pattern=**\aandstr=bwill yieldtrue.- Parameters:
- pattern- The pattern to match against. Must not be- null.
- str- The path to match, as a String. Must not be- null.
- Returns:
- whether or not a given path matches the start of a given pattern up to the first "**".
 
- 
matchPatternStartTests whether or not a given path matches the start of a given pattern up to the first "**". This is not a general purpose test and should only be used if you can live with false positives. For example, pattern=**\aandstr=bwill yieldtrue.- Parameters:
- pattern- The pattern to match against. Must not be- null.
- str- The path to match, as a String. Must not be- null.
- isCaseSensitive- Whether or not matching should be performed case sensitively.
- Returns:
- whether or not a given path matches the start of a given pattern up to the first "**".
 
- 
matchPathTests whether or not a given path matches a given pattern.- Parameters:
- pattern- The pattern to match against. Must not be- null.
- str- The path to match, as a String. Must not be- null.
- Returns:
- trueif the pattern matches against the string, or- falseotherwise.
 
- 
matchPathTests whether or not a given path matches a given pattern.- Parameters:
- pattern- The pattern to match against. Must not be- null.
- str- The path to match, as a String. Must not be- null.
- isCaseSensitive- Whether or not matching should be performed case sensitively.
- Returns:
- trueif the pattern matches against the string, or- falseotherwise.
 
- 
matchTests whether or not a string matches against a pattern. The pattern may contain two special characters:
 '*' means zero or more characters
 '?' means one and only one character- Parameters:
- pattern- The pattern to match against. Must not be- null.
- str- The string which must be matched against the pattern. Must not be- null.
- Returns:
- trueif the string matches against the pattern, or- falseotherwise.
 
- 
matchTests whether or not a string matches against a pattern. The pattern may contain two special characters:
 '*' means zero or more characters
 '?' means one and only one character- Parameters:
- pattern- The pattern to match against. Must not be- null.
- str- The string which must be matched against the pattern. Must not be- null.
- isCaseSensitive- Whether or not matching should be performed case sensitively.
- Returns:
- trueif the string matches against the pattern, or- falseotherwise.
 
- 
setIncludesSets the list of include patterns to use. All '/' and '\' characters are replaced by File.separatorChar, so the separator used need not matchFile.separatorChar.When a pattern ends with a '/' or '\', "**" is appended. - Specified by:
- setIncludesin interface- Scanner
- Parameters:
- includes- A list of include patterns. May be- null, indicating that all files should be included. If a non-- nulllist is given, all elements must be non-- null.
 
- 
setExcludesSets the list of exclude patterns to use. All '/' and '\' characters are replaced by File.separatorChar, so the separator used need not matchFile.separatorChar.When a pattern ends with a '/' or '\', "**" is appended. - Specified by:
- setExcludesin interface- Scanner
- Parameters:
- excludes- A list of exclude patterns. May be- null, indicating that no files should be excluded. If a non-- nulllist is given, all elements must be non-- null.
 
- 
isIncludedTests whether or not a name matches against at least one include pattern.- Parameters:
- name- The name to match. Must not be- null.
- Returns:
- truewhen the name matches against at least one include pattern, or- falseotherwise.
 
- 
isIncluded
- 
isIncluded
- 
couldHoldIncludedTests whether or not a name matches the start of at least one include pattern.- Parameters:
- name- The name to match. Must not be- null.
- Returns:
- truewhen the name matches against the start of at least one include pattern, or- falseotherwise.
 
- 
isExcludedTests whether or not a name matches against at least one exclude pattern.- Parameters:
- name- The name to match. Must not be- null.
- Returns:
- truewhen the name matches against at least one exclude pattern, or- falseotherwise.
 
- 
isExcluded
- 
isExcluded
- 
addDefaultExcludespublic void addDefaultExcludes()Adds default exclusions to the current exclusions set.- Specified by:
- addDefaultExcludesin interface- Scanner
 
- 
setupDefaultFiltersprotected void setupDefaultFilters()
- 
setupMatchPatternsprotected void setupMatchPatterns()
- 
setFilenameComparatorDescription copied from interface:ScannerUse a filename comparator in each directory when scanning.- Specified by:
- setFilenameComparatorin interface- Scanner
- Parameters:
- filenameComparator- the Comparator instance to use
 
 
-