com.cloudconvert.executor.RequestExecutor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudconvert-java Show documentation
Show all versions of cloudconvert-java Show documentation
CloudConvert is an online file converter API - more than 200 different audio, video, document, ebook, archive, image, spreadsheet and presentation formats supported.
package com.cloudconvert.executor;
import com.cloudconvert.client.http.CloseableHttpClientProvider;
import com.cloudconvert.dto.result.Result;
import com.cloudconvert.extractor.ResultExtractor;
import com.fasterxml.jackson.core.type.TypeReference;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.impl.client.CloseableHttpClient;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
public class RequestExecutor extends AbstractRequestExecutor {
public RequestExecutor(
final ResultExtractor resultExtractor,
final CloseableHttpClientProvider closeableHttpClientProvider
) throws IOException {
super(resultExtractor, closeableHttpClientProvider);
}
public Result execute(
@NotNull final HttpUriRequest httpUriRequest, @NotNull final TypeReference typeReference
) throws IOException {
return getResultExtractor().extract(getCloseableHttpClient().execute(httpUriRequest), typeReference);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy