Package oms3.ngmf.util
Class WildcardFileFilter
- java.lang.Object
-
- oms3.ngmf.util.WildcardFileFilter
-
- All Implemented Interfaces:
FileFilter,Serializable
public class WildcardFileFilter extends Object implements FileFilter, Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WildcardFileFilter(String wildcard)Construct a new case-sensitive wildcard filter for a single wildcard.WildcardFileFilter(String wildcard, IOCase caseSensitivity)Construct a new wildcard filter for a single wildcard specifying case-sensitivity.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(File file)Checks to see if the filename matches one of the wildcards.static voidmain(String[] args)
-
-
-
Constructor Detail
-
WildcardFileFilter
public WildcardFileFilter(String wildcard)
Construct a new case-sensitive wildcard filter for a single wildcard.- Parameters:
wildcard- the wildcard to match- Throws:
IllegalArgumentException- if the pattern is null
-
WildcardFileFilter
public WildcardFileFilter(String wildcard, IOCase caseSensitivity)
Construct a new wildcard filter for a single wildcard specifying case-sensitivity.- Parameters:
wildcard- the wildcard to match, not nullcaseSensitivity- how to handle case sensitivity, null means case-sensitive- Throws:
IllegalArgumentException- if the pattern is null
-
-
Method Detail
-
accept
public boolean accept(File file)
Checks to see if the filename matches one of the wildcards.- Specified by:
acceptin interfaceFileFilter- Parameters:
file- the file to check- Returns:
- true if the filename matches one of the wildcards
-
main
public static void main(String[] args)
-
-