Class ClientUri

java.lang.Object
io.helidon.webclient.api.ClientUri
All Implemented Interfaces:
Prototype.Api, UriInfo

public class ClientUri extends Object implements UriInfo
URI abstraction for WebClient.
  • Method Details

    • create

      public static ClientUri create()
      Create an empty URI helper.
      Returns:
      uri helper
    • create

      public static ClientUri create(ClientUri baseUri)
      Create a new client uri.
      Parameters:
      baseUri - base URI
      Returns:
      a new client uri
    • create

      public static ClientUri create(UriInfo baseUri)
      Create a new client uri.
      Parameters:
      baseUri - base URI
      Returns:
      a new client uri
    • create

      public static ClientUri create(URI baseUri)
      Create a new client URI from an existing URI.
      Parameters:
      baseUri - base URI
      Returns:
      a new client uri
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toUri

      public URI toUri()
      Convert instance to URI.
      Returns:
      the converted URI
    • scheme

      public ClientUri scheme(String scheme)
      Scheme of this URI.
      Parameters:
      scheme - to use (such as http)
      Returns:
      updated instance
    • host

      public ClientUri host(String host)
      Host of this URI.
      Parameters:
      host - to connect to
      Returns:
      updated instance
    • port

      public ClientUri port(int port)
      Port of this URI.
      Parameters:
      port - to connect to
      Returns:
      updated instance
    • path

      public ClientUri path(String path)
      Path of this URI.
      Parameters:
      path - path to use
      Returns:
      updated instance
    • skipUriEncoding

      public ClientUri skipUriEncoding(boolean skipUriEncoding)
      Whether to skip uri encoding.
      Parameters:
      skipUriEncoding - skip uri encoding
      Returns:
      updated instance
    • resolve

      public ClientUri resolve(URI uri)
      Resolve the provided URI against this URI.
      Parameters:
      uri - URI to use
      Returns:
      updated instance
    • resolvePath

      public ClientUri resolvePath(String path)
      Resolve the provided path against the current path of this URI.
      Parameters:
      path - to resolve
      Returns:
      updated URI
    • resolve

      public ClientUri resolve(ClientUri uri)
      Replaces the current URI with values from the provided URI.
      Parameters:
      uri - URI to use
      Returns:
      updated instance
    • scheme

      public String scheme()
      Description copied from interface: UriInfo
      Scheme of the request (http, https).
      Specified by:
      scheme in interface UriInfo
      Returns:
      the scheme, defaults to http
    • host

      public String host()
      Description copied from interface: UriInfo
      Host part of authority of the request.
      Specified by:
      host in interface UriInfo
      Returns:
      host, defaults to localhost
    • query

      public UriQuery query()
      Description copied from interface: UriInfo
      URI Query of the request.
      Specified by:
      query in interface UriInfo
      Returns:
      query, may be empty
    • fragment

      public UriFragment fragment()
      Description copied from interface: UriInfo
      Uri Fragment of the request.
      Specified by:
      fragment in interface UriInfo
      Returns:
      fragment, may be empty
    • authority

      public String authority()
    • port

      public int port()
      Description copied from interface: UriInfo
      Port part of authority of the request. If port is not defined (e.g. authority without a port is used, or none is configured), the default port is used based on the defined UriInfo.scheme() - for http the port would be 80, and for https the port would be 443. If the scheme is different, if it ends with s, port would be 443, otherwise 80.
      Specified by:
      port in interface UriInfo
      Returns:
      port
    • path

      public UriPath path()
      Description copied from interface: UriInfo
      Path of the request.
      Specified by:
      path in interface UriInfo
      Returns:
      path
    • fragment

      public ClientUri fragment(UriFragment fragment)
      Configure the fragment for this URI.
      Parameters:
      fragment - fragment to use
      Returns:
      updated URI
    • fragment

      public ClientUri fragment(String fragment)
      Configure the fragment for this URI, using its decoded form ("human readable"). If you have an encoded fragment, please use fragment(io.helidon.common.uri.UriFragment).
      Parameters:
      fragment - decoded fragment
      Returns:
      updated URI
    • writeableQuery

      public UriQueryWriteable writeableQuery()
      URI query that can update values.
      Returns:
      writeable query
    • pathWithQueryAndFragment

      public String pathWithQueryAndFragment()
      Encoded path with query and fragment.
      Returns:
      string containing encoded path with query