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

Package org.apache.hadoop.fs

# Class GlobPattern

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

@Private @Evolving public class GlobPattern extends Object
A class for POSIX glob pattern with brace expansions.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GlobPattern(String globPattern)`
  Construct the glob pattern object with a glob pattern string

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static com.google.re2j.Pattern`
  `compile(String globPattern)`
  Compile glob pattern string
  `com.google.re2j.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 Details

  - ### GlobPattern

    public GlobPattern(String globPattern)
    Construct the glob pattern object with a glob pattern string
    Parameters:
      `globPattern` - the glob pattern string

- ## Method Details

  - ### compiled

    public com.google.re2j.Pattern compiled()
    Returns:
      the compiled pattern

  - ### compile

    public static com.google.re2j.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)