Class ServletPathSpec

  • All Implemented Interfaces:
    java.lang.Comparable<PathSpec>

    public class ServletPathSpec
    extends PathSpec
    • Constructor Detail

      • ServletPathSpec

        public ServletPathSpec​(java.lang.String servletPathSpec)
    • Method Detail

      • normalize

        public static java.lang.String normalize​(java.lang.String pathSpec)
        If a servlet or filter path mapping isn't a suffix mapping, ensure it starts with '/'
        Parameters:
        pathSpec - the servlet or filter mapping pattern
        Returns:
        the pathSpec prefixed by '/' if appropriate
      • getPathInfo

        public java.lang.String getPathInfo​(java.lang.String path)
        Description copied from class: PathSpec
        Return the portion of the path that is after the path spec.
        Specified by:
        getPathInfo in class PathSpec
        Parameters:
        path - the path to match against
        Returns:
        the path info portion of the string
      • getPathMatch

        public java.lang.String getPathMatch​(java.lang.String path)
        Description copied from class: PathSpec
        Return the portion of the path that matches a path spec.
        Specified by:
        getPathMatch in class PathSpec
        Parameters:
        path - the path to match against
        Returns:
        the match, or null if no match at all
      • getRelativePath

        public java.lang.String getRelativePath​(java.lang.String base,
                                                java.lang.String path)
        Description copied from class: PathSpec
        Get the relative path.
        Specified by:
        getRelativePath in class PathSpec
        Parameters:
        base - the base the path is relative to
        path - the additional path
        Returns:
        the base plus path with pathSpec portion removed
      • matches

        public boolean matches​(java.lang.String path)
        Description copied from class: PathSpec
        Test to see if the provided path matches this path spec
        Specified by:
        matches in class PathSpec
        Parameters:
        path - the path to test
        Returns:
        true if the path matches this path spec, false otherwise