@Beta public final class PatternFilenameFilter extends Object implements FilenameFilter
Constructor and Description |
---|
PatternFilenameFilter(Pattern pattern)
Constructs a pattern file name filter object.
|
PatternFilenameFilter(String patternStr)
Constructs a pattern file name filter object.
|
public PatternFilenameFilter(String patternStr)
patternStr
- the pattern string on which to filter file namesPatternSyntaxException
- if pattern compilation fails (runtime)public PatternFilenameFilter(Pattern pattern)
pattern
- the pattern on which to filter file namespublic boolean accept(@Nullable File dir, String fileName)
java.io.FilenameFilter
accept
in interface FilenameFilter
dir
- the directory in which the file was found.fileName
- the name of the file.true
if and only if the name should be
included in the file list; false
otherwise.Copyright © 2010-2014. All Rights Reserved.