Package org.apache.hadoop.fs
Class GlobFilter
java.lang.Object
org.apache.hadoop.fs.GlobFilter
- All Implemented Interfaces:
PathFilter
A filter for POSIX glob pattern with brace expansions.
-
Constructor Summary
ConstructorsConstructorDescriptionGlobFilter(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
Modifier and TypeMethodDescriptionbooleanTests whether or not the specified abstract pathname should be included in a pathname list.boolean
-
Constructor Details
-
GlobFilter
Creates a glob filter with the specified file pattern.- Parameters:
filePattern- the file pattern.- Throws:
IOException- thrown if the file pattern is incorrect.
-
GlobFilter
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 Details
-
hasPattern
public boolean hasPattern() -
accept
Description copied from interface:PathFilterTests whether or not the specified abstract pathname should be included in a pathname list.- Specified by:
acceptin interfacePathFilter- Parameters:
path- The abstract pathname to be tested- Returns:
trueif and only ifpathnameshould be included
-