All Downloads are FREE. Search and download functionalities are using the official Maven repository.

androidMain.aws.sdk.kotlin.crt.io.UriJVM.kt Maven / Gradle / Ivy

There is a newer version: 0.8.9
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

package aws.sdk.kotlin.crt.io
import java.net.URI

internal actual fun parseUri(uri: String): Uri {
    val parsed = URI.create(uri)
    return Uri.build {
        scheme = Protocol.createOrDefault(parsed.scheme)
        host = parsed.host
        port = parsed.port
        path = parsed.path
        if (parsed.query != null && parsed.query.isNotBlank()) parameters = parsed.query
        if (parsed.fragment != null) fragment = parsed.fragment
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy