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

com.cloudconvert.executor.RequestExecutor Maven / Gradle / Ivy

Go to download

CloudConvert is an online file converter API - more than 200 different audio, video, document, ebook, archive, image, spreadsheet and presentation formats supported.

There is a newer version: 1.2.1
Show newest version
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