Package org.jboss.vfs.util
Class SuffixMatchFilter
java.lang.Object
org.jboss.vfs.util.AbstractVirtualFileFilterWithAttributes
org.jboss.vfs.util.SuffixMatchFilter
- All Implemented Interfaces:
VirtualFileFilter
,VirtualFileFilterWithAttributes
Matches a file name against a list of suffixes.
- Version:
- $Revision: 44223 $
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSuffixMatchFilter
(String suffix) Create a new SuffixMatchFilter, usingVisitorAttributes.DEFAULT
SuffixMatchFilter
(String suffix, VisitorAttributes attributes) Create a new SuffixMatchFilter.SuffixMatchFilter
(Collection<String> suffixes) Create a new SuffixMatchFilter.SuffixMatchFilter
(Collection<String> suffixes, VisitorAttributes attributes) Create a new SuffixMatchFilter. -
Method Summary
Modifier and TypeMethodDescriptionboolean
accepts
(VirtualFile file) Accept any file that ends with one of the filter suffixes.Methods inherited from class org.jboss.vfs.util.AbstractVirtualFileFilterWithAttributes
getAttributes
-
Field Details
-
suffixes
The suffixes -
trace
private boolean trace
-
-
Constructor Details
-
SuffixMatchFilter
Create a new SuffixMatchFilter, usingVisitorAttributes.DEFAULT
- Parameters:
suffix
- the suffix- Throws:
IllegalArgumentException
- for a null suffix
-
SuffixMatchFilter
Create a new SuffixMatchFilter.- Parameters:
suffix
- the suffixattributes
- the attributes, pass null to useVisitorAttributes.DEFAULT
- Throws:
IllegalArgumentException
- for a null suffix
-
SuffixMatchFilter
Create a new SuffixMatchFilter.- Parameters:
suffixes
- - the list of file suffixes to accept.- Throws:
IllegalArgumentException
- for a null suffixes
-
SuffixMatchFilter
Create a new SuffixMatchFilter.- Parameters:
suffixes
- - the list of file suffixes to accept.attributes
- the attributes, pass null to useVisitorAttributes.DEFAULT
- Throws:
IllegalArgumentException
- for a null suffixes
-
-
Method Details
-
accepts
Accept any file that ends with one of the filter suffixes. This checks that the file.getName() endsWith a suffix.- Parameters:
file
- the virtual file- Returns:
- true if the file matches a suffix, false otherwise.
-