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

org.octopusden.octopus.infrastructure.teamcity.client.TeamcityClientDecoder.kt Maven / Gradle / Ivy

package org.octopusden.octopus.infrastructure.teamcity.client

import com.fasterxml.jackson.databind.ObjectMapper
import feign.Response
import feign.Util
import feign.jackson.JacksonDecoder
import java.lang.reflect.Type

class TeamcityClientDecoder(val mapper: ObjectMapper) : JacksonDecoder(mapper) {
    override fun decode(response: Response, type: Type): Any {
        return if (type.typeName == String::class.java.typeName) {
            Util.toString(
                response.body().asReader(response.charset())
            )
        } else {
            super.decode(response, type)
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy