Class GlobUtil


  • public final class GlobUtil
    extends java.lang.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 Summary

      Constructors 
      Modifier Constructor Description
      private GlobUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.function.Predicate<java.lang.String> toGlobPatternPredicate​(java.lang.String globPattern)
      Return a predicate that returns true if a string matches the globPattern.
      private static java.util.regex.Pattern toRegexPattern​(java.lang.String globPattern)
      Transform the globPattern to a regex by converting * to .*, ? to ., and escaping other regex special characters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GlobUtil

        private GlobUtil()
    • Method Detail

      • toGlobPatternPredicate

        public static java.util.function.Predicate<java.lang.String> toGlobPatternPredicate​(java.lang.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 java.util.regex.Pattern toRegexPattern​(java.lang.String globPattern)
        Transform the globPattern to a regex by converting * to .*, ? to ., and escaping other regex special characters.