@Beta @GwtIncompatible public final class PatternFilenameFilter extends java.lang.Object implements java.io.FilenameFilter
Constructor and Description |
---|
PatternFilenameFilter(java.util.regex.Pattern pattern)
Constructs a pattern file name filter object.
|
PatternFilenameFilter(java.lang.String patternStr)
Constructs a pattern file name filter object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(@Nullable java.io.File dir,
java.lang.String fileName)
Tests if a specified file should be included in a file list.
|
public PatternFilenameFilter(java.lang.String patternStr)
patternStr
- the pattern string on which to filter file namesjava.util.regex.PatternSyntaxException
- if pattern compilation fails (runtime)public PatternFilenameFilter(java.util.regex.Pattern pattern)
pattern
- the pattern on which to filter file namespublic boolean accept(@Nullable java.io.File dir, java.lang.String fileName)
java.io.FilenameFilter
accept
in interface java.io.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–2021. All rights reserved.