com.github.zeldigas.confclient.ConfluenceUrls.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of text2confl-confluence-client Show documentation
Show all versions of text2confl-confluence-client Show documentation
Implementation of http client for confluence
The newest version!
package com.github.zeldigas.confclient
import io.ktor.http.*
fun makeLink(baseUrl: String, linkFromApi: String) = makeLink(Url(baseUrl), linkFromApi)
fun makeLink(confluenceBaseUrl: Url, linkFromApi: String): Url {
val segments = linkFromApi.split('/').filter { it.isNotEmpty() }
return URLBuilder(confluenceBaseUrl).appendEncodedPathSegments(segments).build()
}