public class CachingHttpClientFactory extends DefaultHttpClientFactory
HttpClientFactory that caches created clients
until the close() method is called.| Constructor and Description |
|---|
CachingHttpClientFactory() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close all HTTP clients created by this factory
|
org.apache.hc.client5.http.impl.classic.CloseableHttpClient |
createHttpClient(org.apache.hc.core5.http.HttpHost httpHost,
boolean acceptAnyCertificate,
int retries,
org.gradle.api.logging.Logger logger,
boolean quiet)
Creates an HTTP client for the given host
|
public org.apache.hc.client5.http.impl.classic.CloseableHttpClient createHttpClient(org.apache.hc.core5.http.HttpHost httpHost,
boolean acceptAnyCertificate,
int retries,
org.gradle.api.logging.Logger logger,
boolean quiet)
HttpClientFactorycreateHttpClient in interface HttpClientFactorycreateHttpClient in class DefaultHttpClientFactoryhttpHost - the host to connect toacceptAnyCertificate - true if HTTPS certificate verification
errors should be ignored and any certificate (even an invalid one)
should be acceptedretries - the number of retries to perform if an HTTP request failslogger - the project's loggerquiet - true if the quiet flag is setpublic void close()
throws java.io.IOException
java.io.IOException - if an I/O error occurs