org.im4java.utils
Class GlobbingFilter
java.lang.Object
org.im4java.utils.BaseFilter
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 filteringpFlags
- the match-flags,
see Pattern.Pattern(String,int)
- Throws:
java.util.regex.PatternSyntaxException
java.lang.IllegalArgumentException
accept
public boolean accept(java.io.File dir,
java.lang.String name)
-
Released under the LGPL, (c) Bernhard Bablok 2008-2010
Homepage: http://im4java.sourceforge.net/