public class PatternFilter
extends java.lang.Object
implements java.io.FilenameFilter
Constructor and Description |
---|
PatternFilter(java.io.File directory,
boolean includeSubdirectories,
java.util.regex.Pattern fileNamePattern)
Specifies the matching conditions for this filter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File directory,
java.lang.String fileName)
Returns true if the file matches the pattern specified with the constructor.
|
int |
getCallCount()
Returns the number of files recently tested by this method.
|
public PatternFilter(java.io.File directory, boolean includeSubdirectories, java.util.regex.Pattern fileNamePattern) throws java.io.IOException
directory
- if null, parent directory will not be tested.fileNamePattern
- pattern to be matched by the file name.java.io.IOException
- if the "directory" argument is not null, but does not denote an existing directory.public boolean accept(java.io.File directory, java.lang.String fileName)
accept
in interface java.io.FilenameFilter
FilenameFilter.accept(java.io.File, java.lang.String)
public int getCallCount()
accept()
method was called
and resets the counter to 0.accept()
since last call to this method