Package info.freelibrary.util
Class RegexDirFilter
- java.lang.Object
-
- info.freelibrary.util.RegexDirFilter
-
- All Implemented Interfaces:
FilenameFilter
public class RegexDirFilter extends Object implements FilenameFilter
AFilenameFilter
that allows filtering directory names based on regular expressions.
-
-
Constructor Summary
Constructors Constructor Description RegexDirFilter(String aPattern)
Constructor for a regular expressionFilenameFilter
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(File aDir, String aFilename)
Determines whether the suppliedFile
in the supplied directory should be included.String
toString()
Returns a string version of the regular expression used as a filter.
-
-
-
Constructor Detail
-
RegexDirFilter
public RegexDirFilter(String aPattern)
Constructor for a regular expressionFilenameFilter
.- Parameters:
aPattern
- The regular expression for the filter
-
-
Method Detail
-
accept
public boolean accept(File aDir, String aFilename)
Determines whether the suppliedFile
in the supplied directory should be included.- Specified by:
accept
in interfaceFilenameFilter
- Parameters:
aDir
- The directory in which theFile
of the file name livesaFilename
- AFile
name to compare against the regular expression; it must be a directory
-
-