Module asciidoclet

Class AntPathMatcher


  • public class AntPathMatcher
    extends Object

    Path matcher implementation for Ant-style path patterns. This implementation matches URLs using the following rules:

    • ? matches one character

    • * matches zero or more characters

    • ** matches zero or more directories in a path

    The instances of this class can be configured via its AntPathMatcher.Builder to:

    1. Use a custom path separator. The default is / character

    2. Ignore character case during comparison. The default is false

    3. Match start. Determines whether the pattern at least matches as far as the given base path goes, assuming that a full path may then match as well. The default is false.

    4. Specify whether to trim tokenized paths. The default is false

    The custom path separator & ignoring character case options were inspired by Spring’s AntPathMatcher

    Class copied from https://github.com/azagniotov/ant-style-path-matcher

    • Method Detail

      • isMatch

        public boolean isMatch​(String pattern,
                               String path)

        Checks if a path matches with a given pattern. Is this method really necessary?

        Parameters:
        pattern - A pattern to be checked with a path.
        path - A path to be checked
        Returns:
        true if path matches pattern. false, otherwise.