de.undercouch.gradle.tasks.download.internal
Class CachingHttpClientFactory
java.lang.Object
de.undercouch.gradle.tasks.download.internal.DefaultHttpClientFactory
de.undercouch.gradle.tasks.download.internal.CachingHttpClientFactory
- All Implemented Interfaces:
- HttpClientFactory
public class CachingHttpClientFactory
- extends DefaultHttpClientFactory
An implementation of HttpClientFactory that caches created clients
until the close() method is called.
|
Method Summary |
void |
close()
Close all HTTP clients created by this factory |
org.apache.http.impl.client.CloseableHttpClient |
createHttpClient(org.apache.http.HttpHost httpHost,
boolean acceptAnyCertificate,
org.apache.http.HttpRequestInterceptor requestInterceptor,
org.apache.http.HttpResponseInterceptor responseInterceptor)
Creates an HTTP client for the given host |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachingHttpClientFactory
public CachingHttpClientFactory()
createHttpClient
public org.apache.http.impl.client.CloseableHttpClient createHttpClient(org.apache.http.HttpHost httpHost,
boolean acceptAnyCertificate,
org.apache.http.HttpRequestInterceptor requestInterceptor,
org.apache.http.HttpResponseInterceptor responseInterceptor)
- Description copied from interface:
HttpClientFactory
- Creates an HTTP client for the given host
- Specified by:
createHttpClient in interface HttpClientFactory- Overrides:
createHttpClient in class DefaultHttpClientFactory
- Parameters:
httpHost - the host to connect toacceptAnyCertificate - true if HTTPS certificate verification
errors should be ignored and any certificate (even an invalid one)
should be acceptedrequestInterceptor - intercepts HTTP requests before they are
sent (may be null)responseInterceptor - intercepts HTTP responses before they are
handled (may be null)
- Returns:
- the HTTP client
close
public void close()
throws java.io.IOException
- Close all HTTP clients created by this factory
- Throws:
java.io.IOException - if an I/O error occurs