org.apache.lenya.util
Class RegexFilter

java.lang.Object
  extended by org.apache.lenya.util.RegexFilter
All Implemented Interfaces:
java.io.FilenameFilter

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

filter out all but files that match a given Regex Pattern,


Constructor Summary
RegexFilter(java.lang.String pattern)
          constructor
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
          Select only files that match the Regex Pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexFilter

public RegexFilter(java.lang.String pattern)
constructor

Parameters:
pattern - Regex pattern applied to simple filename
Method Detail

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Select only files that match the Regex Pattern.

Specified by:
accept in interface java.io.FilenameFilter
Parameters:
dir - the directory in which the file was found.
name - the simple name of the file
Returns:
true if and only if the name should be included in the file list; false otherwise.


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.