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 the FileFilter
interface
that filter files and directories based on regular expressions.
- Version:
- 2.5
- Author:
- nicklas
- Last modified
- $Date: 2008-09-11 22:08:14 +0200 (Thu, 11 Sep 2008) $
Method Summary |
boolean |
accept(File file)
Accept files with a name matching the regular expression |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
filePattern
private final Pattern filePattern
directoryPattern
private final Pattern directoryPattern
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
accept
public boolean accept(File file)
- Accept files with a name matching the regular expression
- Specified by:
accept
in interface FileFilter