Class GlobMatcher

java.lang.Object
org.infinispan.commons.util.GlobMatcher

public final class GlobMatcher extends Object
A matcher for glob patterns.

Matches the glob pattern without transforming into a Pattern. Otherwise, it is possible to convert with GlobUtils.globToRegex(String).

Since:
15.0
Author:
José Bolina
See Also:
  • Method Details

    • match

      public static boolean match(String pattern, String string)
      Checks whether the given string matches the glob pattern.

      Warning: This methods does not accept multi-byte strings.

      Parameters:
      pattern - : Glob pattern to check against.
      string - : String to check for matching.
      Returns:
      true if a match is found, false, otherwise.
      Throws:
      AssertionError - If the is a multi-byte string.
    • match

      public static boolean match(byte[] pattern, byte[] string)
      Checks whether the given byte sequence matches the glob pattern describe as a byte sequence.

      Warning: This method does not accept multi-byte characters.

      Parameters:
      pattern - : The glob pattern represented as a byte sequence.
      string - : The string represented as a byte sequence.
      Returns:
      true if a match is found, false, otherwise.