com.google.common.io
Class PatternFilenameFilter
java.lang.Object
com.google.common.io.PatternFilenameFilter
- All Implemented Interfaces:
- FilenameFilter
@Beta
public final class PatternFilenameFilter
- extends Object
- implements FilenameFilter
File name filter that only accepts files matching a regular expression. This class is thread-safe
and immutable.
- Since:
- 1.0
- Author:
- Apple Chow
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PatternFilenameFilter
public PatternFilenameFilter(String patternStr)
- Constructs a pattern file name filter object.
- Parameters:
patternStr
- the pattern string on which to filter file names
- Throws:
PatternSyntaxException
- if pattern compilation fails (runtime)
PatternFilenameFilter
public PatternFilenameFilter(Pattern pattern)
- Constructs a pattern file name filter object.
- Parameters:
pattern
- the pattern on which to filter file names
accept
public boolean accept(@Nullable
File dir,
String fileName)
- Specified by:
accept
in interface FilenameFilter
Copyright © 2010-2011. All Rights Reserved.