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

com.hexagonkt.http.patterns.LiteralPathPattern.kt Maven / Gradle / Ivy

Go to download

HTTP classes. These classes are shared among the HTTP client and the HTTP server.

The newest version!
package com.hexagonkt.http.patterns

data class LiteralPathPattern(
    override val pattern: String = "",
    override val prefix: Boolean = false
) : PathPattern {

    init {
        checkPathPatternPrefix(pattern)
    }

    override fun addPrefix(prefix: String?): PathPattern =
        if (prefix == null) this
        else createPathPattern(prefix + pattern, this.prefix)

    override fun matches(requestUrl: String): Boolean =
        if (prefix) requestUrl.startsWith(pattern)
        else requestUrl == pattern

    override fun extractParameters(requestUrl: String): Map =
        emptyMap()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy