java.lang.Object
org.apache.sling.discovery.base.connectors.ping.wl.WildcardHelper

public class WildcardHelper extends Object
Helper class for wildcards
  • Constructor Details

    • WildcardHelper

      public WildcardHelper()
  • Method Details

    • wildcardAsRegex

      public static String wildcardAsRegex(String patternWithWildcards)
      converts a string containing wildcards (* and ?) into a valid regex
    • matchesWildcard

      public static boolean matchesWildcard(String comparee, String patternWithWildcards)
      Compare a given string (comparee) against a pattern that contains wildcards and return true if it matches.
      Parameters:
      comparee - the string which should be tested against a pattern containing wildcards
      patternWithWildcards - the pattern containing wildcards (* and ?)
      Returns:
      true if the comparee string matches against the pattern containing wildcards