Builder

Helper class for building or manipulating URI references. Not safe for concurrent use.

An absolute hierarchical URI reference follows the pattern: <scheme>://<authority><absolute path>?<query>#<fragment>

Relative URI references (which are always hierarchical) follow one of two patterns: <relative or absolute path>?<query>#<fragment> or //<authority><absolute path>?<query>#<fragment>

An opaque URI follows this pattern: <scheme>:<opaque part>#<fragment>

Use Uri.buildUpon to obtain a builder representing an existing URI.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun appendEncodedPath(newSegment: String): Uri.Builder

Appends the given segment to the path.

Link copied to clipboard
open override fun appendPath(newSegment: String): Uri.Builder

Encodes the given segment and appends it to the path.

Link copied to clipboard
open override fun appendQueryParameter(key: String, value: String?): Uri.Builder

Encodes the key and value and then appends the parameter to the query string.

Link copied to clipboard
open override fun authority(authority: String?): Uri.Builder

Encodes and sets the authority.

Link copied to clipboard
open override fun build(): Uri

Constructs a Uri with the current attributes.

Link copied to clipboard
open override fun clearQuery(): Uri.Builder

Clears the the previously set query.

Link copied to clipboard
open override fun encodedAuthority(authority: String?): Uri.Builder

Sets the previously encoded authority.

Link copied to clipboard
open override fun encodedFragment(fragment: String?): Uri.Builder

Sets the previously encoded fragment.

Link copied to clipboard
open override fun encodedOpaquePart(opaquePart: String?): Uri.Builder

Sets the previously encoded opaque scheme-specific-part.

Link copied to clipboard
open override fun encodedPath(path: String?): Uri.Builder

Sets the previously encoded path.

Link copied to clipboard
open override fun encodedQuery(query: String?): Uri.Builder

Sets the previously encoded query.

Link copied to clipboard
open override fun fragment(fragment: String?): Uri.Builder

Encodes and sets the fragment.

Link copied to clipboard
open override fun opaquePart(opaquePart: String?): Uri.Builder

Encodes and sets the given opaque scheme-specific-part.

Link copied to clipboard
open override fun path(path: String?): Uri.Builder

Sets the path. Leaves '/' characters intact but encodes others as necessary.

Link copied to clipboard
open override fun query(query: String?): Uri.Builder

Encodes and sets the query.

Link copied to clipboard
open override fun scheme(scheme: String?): Uri.Builder

Sets the scheme.

Link copied to clipboard
open override fun toString(): String