com.beasys.commerce.util
Class GlobHelper

java.lang.Object
  extended by com.beasys.commerce.util.GlobHelper
All Implemented Interfaces
FilenameFilter

Deprecated Use GlobHelper

@Deprecated
public class GlobHelper
extends Object
implements FilenameFilter

A utility class for doing DOS-style pattern matching (GLOBing).

This supports only '?' and '*' pattern characters. No bounded (e.g. "[abcd] file") patterns are supported.

To do a simple pattern match, you can use the matches class method. Additionally, GlobHelper is a FilenameFilter.

This requires the OROMatcher regular expression libraries, which are bundled with WebLogic Server.

Since:
2.0

Field Summary
protected  List patterns
          Deprecated Our list of file patterns to match.
 
Constructor Summary
GlobHelper()
          Deprecated Constructor.
GlobHelper(Collection c)
          Deprecated Constructor with patterns.
GlobHelper(Iterator i)
          Deprecated Constructor with patterns.
GlobHelper(String pattern)
          Deprecated Constructor with pattern.
GlobHelper(String[] patterns)
          Deprecated Constructor with patterns.
 
Method Summary
 boolean accept(File dir, String name)
          Deprecated Tell if the specified directory and filename matches our current list patterns.
 void addPattern(String pat)
          Deprecated Add a pattern.
static com.oroinc.text.regex.Pattern getPattern(String patStr)
          Deprecated Get a pattern from the pattern cache, which is a soft reference map of pattern string to Pattern.
 List getPatterns()
          Deprecated Get the patterns.
static boolean matches(String patStr, String str)
          Deprecated Determine if the given input string matches the specified input pattern.
 boolean removePattern(String pat)
          Deprecated Remove a pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

patterns

protected List patterns
Deprecated 
Our list of file patterns to match.

Constructor Detail

GlobHelper

public GlobHelper()
Deprecated 
Constructor.


GlobHelper

public GlobHelper(String pattern)
Deprecated 
Constructor with pattern.


GlobHelper

public GlobHelper(String[] patterns)
Deprecated 
Constructor with patterns.


GlobHelper

public GlobHelper(Collection c)
Deprecated 
Constructor with patterns.


GlobHelper

public GlobHelper(Iterator i)
Deprecated 
Constructor with patterns.

Method Detail

addPattern

public void addPattern(String pat)
Deprecated 
Add a pattern.


removePattern

public boolean removePattern(String pat)
Deprecated 
Remove a pattern.


getPatterns

public List getPatterns()
Deprecated 
Get the patterns.


accept

public boolean accept(File dir,
                      String name)
Deprecated 
Tell if the specified directory and filename matches our current list patterns.

Specified by:
accept in interface FilenameFilter

matches

public static boolean matches(String patStr,
                              String str)
                       throws IllegalArgumentException
Deprecated 
Determine if the given input string matches the specified input pattern.

Parameters
pat - the pattern (e.g. "Some*Cl?.java").
str - the input string.
Returns
true if the input string matches the pattern, false if not
Throws
IllegalArgumentException - thrown on a bad pattern string.

getPattern

public static com.oroinc.text.regex.Pattern getPattern(String patStr)
                                                throws com.oroinc.text.regex.MalformedPatternException
Deprecated 
Get a pattern from the pattern cache, which is a soft reference map of pattern string to Pattern.

By using a sort reference map, the garbage collector can clean it out as needed because we can always recreate the Pattern objects from the strings.

Throws
com.oroinc.text.regex.MalformedPatternException - thrown on a bad pattern string


Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.