org.apache.hadoop.fs
Class GlobPattern

java.lang.Object
  extended by org.apache.hadoop.fs.GlobPattern

public class GlobPattern
extends Object

A class for POSIX glob pattern with brace expansions.


Constructor Summary
GlobPattern(String globPattern)
          Construct the glob pattern object with a glob pattern string
 
Method Summary
static Pattern compile(String globPattern)
          Compile glob pattern string
 Pattern compiled()
           
 boolean hasWildcard()
           
 boolean matches(CharSequence s)
          Match input against the compiled glob pattern
 void set(String glob)
          Set and compile a glob pattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobPattern

public GlobPattern(String globPattern)
Construct the glob pattern object with a glob pattern string

Parameters:
globPattern - the glob pattern string
Method Detail

compiled

public Pattern compiled()
Returns:
the compiled pattern

compile

public static Pattern compile(String globPattern)
Compile glob pattern string

Parameters:
globPattern - the glob pattern
Returns:
the pattern object

matches

public boolean matches(CharSequence s)
Match input against the compiled glob pattern

Parameters:
s - input chars
Returns:
true for successful matches

set

public void set(String glob)
Set and compile a glob pattern

Parameters:
glob - the glob pattern string

hasWildcard

public boolean hasWildcard()
Returns:
true if this is a wildcard pattern (with special chars)


Copyright © 2009 The Apache Software Foundation