@Beta @GwtIncompatible 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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(File dir,
String fileName)
Tests if a specified file should be included in a file list.
|
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(@NullableDecl 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–2018. All rights reserved.