Package org.apache.commons.vfs2
Class PatternFileSelector
java.lang.Object
org.apache.commons.vfs2.PatternFileSelector
- All Implemented Interfaces:
FileSelector
A
FileSelector
that selects based on regular expressions matched against base filename.- Since:
- 2.1
-
Constructor Summary
ConstructorsConstructorDescriptionPatternFileSelector
(String regex) Creates a new selector for the given pattern.PatternFileSelector
(String regex, int flags) Creates a new selector for the given Pattern and flags.PatternFileSelector
(Pattern pattern) Creates a new selector for the given pattern. -
Method Summary
Modifier and TypeMethodDescriptionboolean
includeFile
(FileSelectInfo fileInfo) Determines if a file or folder should be selected.toString()
boolean
traverseDescendents
(FileSelectInfo fileInfo) Determines whether a folder should be traversed.
-
Constructor Details
-
PatternFileSelector
Creates a new selector for the given pattern.- Parameters:
pattern
- The regular expressed used by this selector.
-
PatternFileSelector
Creates a new selector for the given pattern.- Parameters:
regex
- The regular expressed used by this selector.
-
PatternFileSelector
Creates a new selector for the given Pattern and flags.- Parameters:
regex
- The expression to be compiledflags
- Match flags, a bit mask.- See Also:
-
-
Method Details
-
includeFile
Determines if a file or folder should be selected.- Specified by:
includeFile
in interfaceFileSelector
- Parameters:
fileInfo
- The file selection information.- Returns:
- true if the file should be selected, false otherwise.
-
toString
-
traverseDescendents
Determines whether a folder should be traversed.- Specified by:
traverseDescendents
in interfaceFileSelector
- Parameters:
fileInfo
- The file selection information.- Returns:
- true if descendants should be traversed, false otherwise.
-