Class WildcardPath

java.lang.Object
org.apache.parquet.glob.WildcardPath

public class WildcardPath extends Object
Holds a String with wildcards ('*'), and can answer whether a given string matches this WildcardPath. For example: "foo.*.baz" or "foo*baz.bar*"

The '*' in "foo*bar" is treated the same way that java regex treats "(.*)", and all WildcardPath's are considered to match child paths. For example, "foo.bar" will match "foo.bar.baz". It will not match "foo.barbaz" however. To match "foo.barbaz" the pattern "foo.bar*" could be used, which would also match "foo.barbaz.x"

Only '*' is considered a special character. All other characters are not treated as special characters, including '{', '}', '.', and '/' with one exception -- the delimiter character is used for matching against child paths as explained above.

It is assumed that {} globs have already been expanded before constructing this object.

  • Constructor Details

    • WildcardPath

      public WildcardPath(String parentGlobPath, String wildcardPath, char delim)
  • Method Details

    • buildRegex

      public static String buildRegex(String wildcardPath, char delim)
    • matches

      public boolean matches(String path)
    • getParentGlobPath

      public String getParentGlobPath()
    • getOriginalPattern

      public String getOriginalPattern()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object