org.springframework.http.server

Interface PathContainer

  • All Known Subinterfaces:
    RequestPath


    public interface PathContainer
    Structured representation of a URI path whose elements have been pre-parsed into a sequence of Separator and PathSegment elements.

    An instance of this class can be created via parsePath(String). Each PathSegment exposes its structure decoded safely without the risk of encoded reserved characters altering the path or segment structure and without path parameters for path matching purposes.

    Since:
    5.0
    Author:
    Rossen Stoyanchev
    • Method Detail

      • value

        java.lang.String value()
        The original path that was parsed.
      • subPath

        default PathContainer subPath(int index)
        Extract a sub-path from the given offset into the elements list.
        Parameters:
        index - the start element index (inclusive)
        Returns:
        the sub-path
      • subPath

        default PathContainer subPath(int startIndex,
                                      int endIndex)
        Extract a sub-path from the given start offset (inclusive) into the element list and to the end offset (exclusive).
        Parameters:
        startIndex - the start element index (inclusive)
        endIndex - the end element index (exclusive)
        Returns:
        the sub-path
      • parsePath

        static PathContainer parsePath(java.lang.String path)
        Parse the path value into a sequence of Separator and PathSegment elements.
        Parameters:
        path - the encoded, raw URL path value to parse
        Returns:
        the parsed path