com.jdroid.java.http.okhttp.ParseCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdroid-java-http-okhttp Show documentation
Show all versions of jdroid-java-http-okhttp Show documentation
OKHttp Http Layer Implementation for Jdroid
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;
public class ParseCommand extends OkHttpCommand {
private Parser parser;
public ParseCommand(Parser parser) {
this.parser = parser;
}
@Override
protected Object doExecute(InputStream inputStream) throws IOException {
try {
return parser.parse(inputStream);
} catch (UnexpectedException e) {
Throwable throwable = e.getCause();
if (throwable instanceof IOException) {
throw (IOException)throwable;
} else {
throw e;
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy