Interface UriPath

All Known Subinterfaces:
RoutedPath

public interface UriPath
Abstraction of HTTP path supporting matrix parameters. Note that matrix parameters are ONLY available on absolute() path or on segments().
  • Method Summary

    Modifier and Type
    Method
    Description
    If this instance represents a path relative to some context root then returns absolute requested path otherwise returns this instance.
    static UriPath
    create(String rawPath)
    Create a new path from its raw representation.
    static UriPath
    Create a new path from its decoded representation.
    static UriPath
    createRelative(UriPath uriPath, String relativePath)
    Creates a relative path from the provided path and the relative segment(s).
    Path parameters collected from the full path.
    Decoded path without matrix parameters.
    Path as it was received on the wire (Server request), or path as it will be sent over the wire (Client request).
    Path as it was received on the wire (Server request), or path as it will be sent over the wire (Client request) WITHOUT matrix parameters.
    static UriPath
    Create a new root path.
    List of segments.
    void
    Validate if the raw path is valid.
  • Method Details

    • createRelative

      static UriPath createRelative(UriPath uriPath, String relativePath)
      Creates a relative path from the provided path and the relative segment(s).
      Parameters:
      uriPath - used to obtain absolute path
      relativePath - relative segment, must not contain path parameters and is expected to be decoded
      Returns:
      a new path representing the new relative path
    • create

      static UriPath create(String rawPath)
      Create a new path from its raw representation.
      Parameters:
      rawPath - raw path as received over the wire
      Returns:
      a new HTTP path
    • createFromDecoded

      static UriPath createFromDecoded(String decodedPath)
      Create a new path from its decoded representation.
      Parameters:
      decodedPath - path as used in routing
      Returns:
      a new HTTP path
    • root

      static UriPath root()
      Create a new root path.
      Returns:
      a new HTTP path
    • rawPath

      String rawPath()
      Path as it was received on the wire (Server request), or path as it will be sent over the wire (Client request). This path may include path parameters.
      Returns:
      path
    • rawPathNoParams

      String rawPathNoParams()
      Path as it was received on the wire (Server request), or path as it will be sent over the wire (Client request) WITHOUT matrix parameters.
      Returns:
      path
    • path

      String path()
      Decoded path without matrix parameters.
      Returns:
      path without matrix parameters
      See Also:
    • matrixParameters

      Parameters matrixParameters()
      Path parameters collected from the full path. Example of path with parameter: /users;domain=work/john. domain is the name of the parameter, work is value of the parameter.
      Returns:
      path parameters
    • absolute

      UriPath absolute()
      If this instance represents a path relative to some context root then returns absolute requested path otherwise returns this instance.

      The absolute path also contains access to path parameters defined in context matchers. If there is name conflict then value represents latest matcher result.

      Returns:
      an absolute requested URI path
    • segments

      default List<UriPathSegment> segments()
      List of segments. This is the most detailed access to the underlying path that provides raw, decoded access to path, access to matrix parameters bound to each segment.

      NOTE: this is an expensive method that requires full parsing of the path, please use with care

      Returns:
      list of URI path segments
    • validate

      void validate()
      Validate if the raw path is valid.