org.apache.hadoop.fs
Class GlobFilter

java.lang.Object
  extended by org.apache.hadoop.fs.GlobFilter
All Implemented Interfaces:
PathFilter

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class GlobFilter
extends Object
implements PathFilter

A filter for POSIX glob pattern with brace expansions.


Constructor Summary
GlobFilter(String filePattern)
          Creates a glob filter with the specified file pattern.
GlobFilter(String filePattern, PathFilter filter)
          Creates a glob filter with the specified file pattern and an user filter.
 
Method Summary
 boolean accept(Path path)
          Tests whether or not the specified abstract pathname should be included in a pathname list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobFilter

public GlobFilter(String filePattern)
           throws IOException
Creates a glob filter with the specified file pattern.

Parameters:
filePattern - the file pattern.
Throws:
IOException - thrown if the file pattern is incorrect.

GlobFilter

public GlobFilter(String filePattern,
                  PathFilter filter)
           throws IOException
Creates a glob filter with the specified file pattern and an user filter.

Parameters:
filePattern - the file pattern.
filter - user filter in addition to the glob pattern.
Throws:
IOException - thrown if the file pattern is incorrect.
Method Detail

accept

public boolean accept(Path path)
Description copied from interface: PathFilter
Tests whether or not the specified abstract pathname should be included in a pathname list.

Specified by:
accept in interface PathFilter
Parameters:
path - The abstract pathname to be tested
Returns:
true if and only if pathname should be included


Copyright © 2014 Apache Software Foundation. All Rights Reserved.