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

com.jdroid.java.http.okhttp.ParseCommand.kt Maven / Gradle / Ivy

The newest version!
package com.jdroid.java.http.okhttp

import com.jdroid.java.exception.UnexpectedException
import com.jdroid.java.http.parser.Parser

import java.io.IOException
import java.io.InputStream

class ParseCommand(private val parser: Parser) : OkHttpCommand() {

    @Throws(IOException::class)
    override fun doExecute(inputStream: InputStream): Any? {
        try {
            return parser.parse(inputStream)
        } catch (e: UnexpectedException) {
            val throwable = e.cause
            if (throwable is IOException) {
                throw throwable
            } else {
                throw e
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy