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