Class URLPattern

    • Constructor Detail

      • URLPattern

        public URLPattern()
      • URLPattern

        public URLPattern​(String urlPattern)
    • Method Detail

      • patternType

        public int patternType()
      • implies

        public boolean implies​(URLPattern urlPattern)
        Does this pattern imply (that is, match) the argument pattern? This method follows the same rules (in the same order) as those used for mapping requests to servlets.

        Two URL patterns match if they are related as follows:

        • their pattern values are String equivalent, or
        • this pattern is the path-prefix pattern "/*", or
        • this pattern is a path-prefix pattern (that is, it starts with "/" and ends with "/*") and the argument pattern starts with the substring of this pattern, minus its last 2 characters, and the next character of the argument pattern, if there is one, is "/", or
        • this pattern is an extension pattern (that is, it starts with "*.") and the argument pattern ends with this pattern, or
        • the reference pattern is the special default pattern, "/", which matches all argument patterns.
        Parameters:
        urlPattern - URLPattern whose path will be compared to this URLPattern
        Returns:
        Whether the given URLPattern matches the present URLPattern.
      • getPatternDepth

        public int getPatternDepth()
      • match

        public static boolean match​(String originalPattern,
                                    String newPattern)
        Minor utility method which instantiates a pattern before comparing it against another.
        Parameters:
        originalPattern - The pattern to compare against
        newPattern - The pattern to compare
        Returns: