Package net.sf.basedb.util
Class RegexpFileFilter
- java.lang.Object
-
- net.sf.basedb.util.RegexpFileFilter
-
- All Implemented Interfaces:
FileFilter
public class RegexpFileFilter extends Object implements FileFilter
An implementation of theFileFilter
interface that filter files and directories based on regular expressions.- Version:
- 2.5
- Author:
- nicklas
- Last modified
- $Date: 2012-09-14 09:28:35 +0200 (fr, 14 sep 2012) $
-
-
Field Summary
Fields Modifier and Type Field Description private Pattern
directoryPattern
private Pattern
filePattern
-
Constructor Summary
Constructors Constructor Description RegexpFileFilter(String fileRegexp, String directoryRegexp)
Create a new file filter from a string regular expressions.RegexpFileFilter(Pattern filePattern, Pattern directoryPattern)
Create a new file filter from patterns.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(File file)
Accept files with a name matching the regular expression
-
-
-
Constructor Detail
-
RegexpFileFilter
public RegexpFileFilter(String fileRegexp, String directoryRegexp)
Create a new file filter from a string regular expressions.- Parameters:
fileRegexp
- The regular expression used to match file names or null to match all filesdirectoryRegexp
- The regular expression used to match directory names or null to match all directories
-
RegexpFileFilter
public RegexpFileFilter(Pattern filePattern, Pattern directoryPattern)
Create a new file filter from patterns.- Parameters:
filePattern
- The pattern used to match file names, or null to match all filesdirectoryPattern
- The pattern used to match the directory names, or null to match all directories
-
-
Method Detail
-
accept
public boolean accept(File file)
Accept files with a name matching the regular expression- Specified by:
accept
in interfaceFileFilter
-
-