The im4java Library, Version 1.4.0

org.im4java.utils
Class GlobbingFilter

java.lang.Object
  extended by org.im4java.utils.BaseFilter
      extended by org.im4java.utils.GlobbingFilter
All Implemented Interfaces:
java.io.FilenameFilter

public class GlobbingFilter
extends BaseFilter

This utility-class implements a FilenameFilter based on shell-globbing. This filter is a simple variant of the RegexFilter and just replaces a "*" with ".*" and a "." with "\.".

Since:
1.1.0
Version:
$Revision: 1.2 $
Author:
$Author: bablokb $

Constructor Summary
GlobbingFilter(java.lang.String pPattern)
          Construct the filter using the given pattern.
GlobbingFilter(java.lang.String pPattern, int pFlags)
          Construct the filter using the given pattern and match-flags
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
          
 
Methods inherited from class org.im4java.utils.BaseFilter
acceptDir, ignoreDotDirs, setRecursion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobbingFilter

public GlobbingFilter(java.lang.String pPattern)
               throws java.util.regex.PatternSyntaxException
Construct the filter using the given pattern.

Parameters:
pPattern - the regular expression to use during filtering
Throws:
java.util.regex.PatternSyntaxException

GlobbingFilter

public GlobbingFilter(java.lang.String pPattern,
                      int pFlags)
               throws java.util.regex.PatternSyntaxException,
                      java.lang.IllegalArgumentException
Construct the filter using the given pattern and match-flags

Parameters:
pPattern - the regular expression to use during filtering
pFlags - the match-flags, see Pattern.Pattern(String,int)
Throws:
java.util.regex.PatternSyntaxException
java.lang.IllegalArgumentException
Method Detail

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)


The im4java Library, Version 1.4.0

Released under the LGPL, (c) Bernhard Bablok 2008-2010
Homepage: http://im4java.sourceforge.net/