de.undercouch.gradle.tasks.download.internal
Class DefaultHttpClientFactory

java.lang.Object
  extended by de.undercouch.gradle.tasks.download.internal.DefaultHttpClientFactory
All Implemented Interfaces:
HttpClientFactory
Direct Known Subclasses:
CachingHttpClientFactory

public class DefaultHttpClientFactory
extends java.lang.Object
implements HttpClientFactory

Default implementation of HttpClientFactory. Creates a new client every time createHttpClient(HttpHost, boolean, HttpRequestInterceptor, HttpResponseInterceptor) is called. The caller is responsible for closing this client.


Constructor Summary
DefaultHttpClientFactory()
           
 
Method Summary
 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
 

Constructor Detail

DefaultHttpClientFactory

public DefaultHttpClientFactory()
Method Detail

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
Parameters:
httpHost - the host to connect to
acceptAnyCertificate - true if HTTPS certificate verification errors should be ignored and any certificate (even an invalid one) should be accepted
requestInterceptor - 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