cynosurex.io
Class RegExFilenameFilter

java.lang.Object
  extended by cynosurex.io.RegExFilenameFilter
All Implemented Interfaces:
java.io.FilenameFilter

public class RegExFilenameFilter
extends java.lang.Object
implements java.io.FilenameFilter

This FilenameFilter allows the matching of files with regular expression.

Version:
1.0
Author:
Chieh Cheng

Constructor Summary
RegExFilenameFilter(java.lang.String regex)
          Constructor.
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String fileName)
          This method called by the File object to determine whether to accept a filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegExFilenameFilter

public RegExFilenameFilter(java.lang.String regex)
Constructor.

Parameters:
regex - The regular expression to match.
Method Detail

accept

public boolean accept(java.io.File dir,
                      java.lang.String fileName)
This method called by the File object to determine whether to accept a filename.

Specified by:
accept in interface java.io.FilenameFilter
Parameters:
dir - The directory where the file is located.
fileName - The name of the file.