class URLBuilder
A URL builder with all mutable components
URLBuilder(protocol: URLProtocol = URLProtocol.HTTP, host: String = "localhost", port: Int = DEFAULT_PORT, user: String? = null, password: String? = null, encodedPath: String = "/", parameters: ParametersBuilder = ParametersBuilder(), fragment: String = "", trailingQuery: Boolean = false)
A URL builder with all mutable components |
var encodedPath: String
encoded URL path without query |
|
var fragment: String
URL fragment (anchor name) |
|
var host: String
name without port (domain) |
|
val parameters: ParametersBuilder
URL query parameters |
|
var password: String?
password part (optional) |
|
var port: Int
port number |
|
var protocol: URLProtocol
URL protocol (scheme) |
|
var trailingQuery: Boolean
keep a trailing question character even if there are no query parameters |
|
var user: String?
username part (optional) |
fun build(): Url
Build a Url instance (everything is copied to a new instance) |
|
fun buildString(): String
Build a URL string |
|
fun path(vararg components: String): URLBuilder fun path(components: List<String>): URLBuilder
Encode components to encodedPath |
val URLBuilder.authority: String
URLBuilder authority. |
fun URLBuilder.clone(): URLBuilder
Create a copy of this builder. Modifications in a copy is not reflected in the original instance and vise-versa. |
|
fun URLBuilder.pathComponents(components: List<String>): URLBuilder fun URLBuilder.pathComponents(vararg components: String): URLBuilder
Adds components to current encodedPath |
|
fun URLBuilder.takeFrom(urlString: String): URLBuilder
Take url parts from urlString throws URLParserException fun URLBuilder.takeFrom(url: URLBuilder): URLBuilder
Take components from another url builder fun URLBuilder.takeFrom(url: Url): URLBuilder
Take components from another url fun URLBuilder.takeFrom(uri: URI): URLBuilder
Take URI components from uri fun URLBuilder.takeFrom(url: URL): URLBuilder
Take URI components from url |