GlobFilter (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.fs, class: GlobFilter

Package org.apache.hadoop.fs

# Class GlobFilter

java.lang.Object
org.apache.hadoop.fs.GlobFilter

All Implemented Interfaces:
  `PathFilter`

@Public @Evolving public class GlobFilter extends Object implements PathFilter
A filter for POSIX glob pattern with brace expansions.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `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

  Modifier and Type
  Method
  Description
  `boolean`
  `accept(Path path)`
  Tests whether or not the specified abstract pathname should be included in a pathname list.
  `boolean`
  `hasPattern()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### 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 Details

  - ### hasPattern

    public boolean hasPattern()

  - ### 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