Class GlobUtil

java.lang.Object
io.opentelemetry.sdk.internal.GlobUtil

public final class GlobUtil extends Object
Utilities for glob pattern matching.

This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

  • Constructor Details

    • GlobUtil

      private GlobUtil()
  • Method Details

    • toGlobPatternPredicate

      public static Predicate<String> toGlobPatternPredicate(String globPattern)
      Return a predicate that returns true if a string matches the globPattern.

      globPattern may contain the wildcard characters * and ? with the following matching criteria:

      • * matches 0 or more instances of any character
      • ? matches exactly one instance of any character
    • toRegexPattern

      private static Pattern toRegexPattern(String globPattern)
      Transform the globPattern to a regex by converting * to .*, ? to ., and escaping other regex special characters.