Interface PathAndQuery

All Superinterfaces:
org.wiremock.stringparser.ParsedString, RelativeUrl, Uri, Url

public interface PathAndQuery extends RelativeUrl
Represents a path and query component combination, which is a type of relative reference.

A PathAndQuery consists of a path and an optional query, with no scheme, authority, or fragment. It is typically used to represent the part of a URL after the authority.

Implementations must be immutable and thread-safe.

  • Field Details

    • EMPTY

      static final PathAndQuery EMPTY
      An empty path and query with no components.
  • Method Details

    • getAuthority

      @Deprecated default @Nullable Authority getAuthority()
      Deprecated.
      This always returns null so you have no reason to ever call it
      Implementations must ALWAYS return null
      Specified by:
      getAuthority in interface Uri
      Returns:
      null
    • getFragment

      @Deprecated default @Nullable Fragment getFragment()
      Deprecated.
      This always returns null so you have no reason to ever call it
      Implementations must ALWAYS return null
      Specified by:
      getFragment in interface Uri
      Returns:
      null
    • getPathAndQuery

      @Deprecated default PathAndQuery getPathAndQuery()
      Deprecated.
      Description copied from interface: Url
      Returns the path and query components combined.
      Specified by:
      getPathAndQuery in interface Url
      Returns:
      the path and query
    • parse

      static PathAndQuery parse(String pathAndQuery) throws IllegalPathAndQuery
      Parses a string into a path and query.
      Parameters:
      pathAndQuery - the string to parse
      Returns:
      the parsed path and query
      Throws:
      IllegalPathAndQuery - if the string is not a valid path and query
    • of

      static PathAndQuery of(Path path)
    • of

      static PathAndQuery of(Path path, @Nullable Query query)
    • removePathPrefix

      default PathAndQuery removePathPrefix(Path prefix)