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

com.cloudconvert.client.http.CloseableHttpClientProvider 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.client.http;

import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;

public class CloseableHttpClientProvider extends AbstractCloseableHttpClientProvider {

    public CloseableHttpClientProvider() {
        super(DEFAULT_MAX_PER_ROUTE, MAX_TOTAL);
    }

    public CloseableHttpClientProvider(final int defaultMaxPerRoute, final int maxTotal) {
        super(defaultMaxPerRoute, maxTotal);
    }

    @Override
    public CloseableHttpClient provide() {
        final PoolingHttpClientConnectionManager poolingHttpClientConnectionManager = new PoolingHttpClientConnectionManager();
        poolingHttpClientConnectionManager.setDefaultMaxPerRoute(getDefaultMaxPerRoute());
        poolingHttpClientConnectionManager.setMaxTotal(getMaxTotal());

        return HttpClientBuilder.create().setConnectionManager(poolingHttpClientConnectionManager).build();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy