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

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

Go to download

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

There is a newer version: 3.7.0
Show newest version
package com.hexagonkt.http.patterns

import com.hexagonkt.http.patterns.TemplatePathPattern.Companion.WILDCARD

data class WildcardPathPattern(override val prefix: Boolean = false) : PathPattern {

    override val pattern: String = WILDCARD

    override fun addPrefix(prefix: String?): PathPattern =
        if (prefix == null) this
        else createPathPattern("$prefix$WILDCARD", this.prefix)

    override fun matches(requestUrl: String): Boolean =
        true

    override fun extractParameters(requestUrl: String): Map =
        mapOf(1.toString() to requestUrl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy