Class GlobUtils


  • final class GlobUtils
    extends java.lang.Object
    Utility routines for converting glob patterns to regular expressions.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String SPECIAL_CHARS
      Character with special meaning in regular expression namespace.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private GlobUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.regex.Pattern glob2pattern​(java.lang.String glob)
      Create Pattern from wildcard patter.
      static java.lang.String glob2re​(java.lang.String glob)
      Convert wildcard pattern to regular expression.
      • Methods inherited from class java.lang.Object

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

      • SPECIAL_CHARS

        private static final java.lang.String SPECIAL_CHARS
        Character with special meaning in regular expression namespace. These characters should be escaped when converting glob expression to regular expression.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GlobUtils

        private GlobUtils()
    • Method Detail

      • glob2re

        public static java.lang.String glob2re​(java.lang.String glob)
        Convert wildcard pattern to regular expression.
        Parameters:
        glob - wildcard pattern to convert
        Returns:
        regular expression
      • glob2pattern

        public static java.util.regex.Pattern glob2pattern​(java.lang.String glob)
        Create Pattern from wildcard patter.
        Parameters:
        glob - wildcard pattern to convert
        Returns:
        pattern corresponding to given wildcard pattern