Interface IMatcher

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static IMatcher NO_MATCH
      Matcher that does not match any pattern.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      static IMatcher createPathMatcher​(java.lang.String pattern, boolean dirOnly)
      Creates a path matcher for the given pattern.
      boolean matches​(java.lang.String path, boolean assumeDirectory, boolean pathMatch)
      Matches entire given string
      boolean matches​(java.lang.String segment, int startIncl, int endExcl)
      Matches only part of given string
    • Field Detail

      • NO_MATCH

        static final IMatcher NO_MATCH
        Matcher that does not match any pattern.
    • Method Detail

      • createPathMatcher

        @NonNull
        static IMatcher createPathMatcher​(@NonNull
                                          java.lang.String pattern,
                                          boolean dirOnly)
                                   throws InvalidPatternException
        Creates a path matcher for the given pattern. A pattern may contain the wildcards "?", "*", and "**". The directory separator is '/'.
        Parameters:
        pattern - to match
        dirOnly - whether to match only directories
        Returns:
        a matcher for the given pattern
        Throws:
        InvalidPatternException - if the pattern is invalid
      • matches

        boolean matches​(java.lang.String path,
                        boolean assumeDirectory,
                        boolean pathMatch)
        Matches entire given string
        Parameters:
        path - string which is not null, but might be empty
        assumeDirectory - true to assume this path as directory (even if it doesn't end with a slash)
        pathMatch - true if the match is for the full path: prefix-only matches are not allowed
        Returns:
        true if this matcher pattern matches given string
      • matches

        boolean matches​(java.lang.String segment,
                        int startIncl,
                        int endExcl)
        Matches only part of given string
        Parameters:
        segment - string which is not null, but might be empty
        startIncl - start index, inclusive
        endExcl - end index, exclusive
        Returns:
        true if this matcher pattern matches given string