Class HttpClientProxy
java.lang.Object
org.codehaus.mojo.license.utils.HttpClientProxy
Applies a proxy from
settings.xml to an Apache HttpClient, so that every download of the plugin goes through
the same proxy code path.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigure(org.apache.maven.settings.Proxy proxy, org.apache.http.client.config.RequestConfig.Builder requestConfig, org.apache.http.impl.client.HttpClientBuilder clientBuilder) Configures the proxy, its credentials and its non-proxy hosts on the given builders.static org.apache.maven.settings.ProxyfindActiveProxy(Collection<org.apache.maven.settings.Proxy> proxies) Finds the proxy to use among the proxies declared insettings.xml.
-
Method Details
-
findActiveProxy
public static org.apache.maven.settings.Proxy findActiveProxy(Collection<org.apache.maven.settings.Proxy> proxies) Finds the proxy to use among the proxies declared insettings.xml.- Parameters:
proxies- the declared proxies, may benull- Returns:
- the first active
httpproxy, ornullif there is none
-
configure
public static void configure(org.apache.maven.settings.Proxy proxy, org.apache.http.client.config.RequestConfig.Builder requestConfig, org.apache.http.impl.client.HttpClientBuilder clientBuilder) Configures the proxy, its credentials and its non-proxy hosts on the given builders. Does nothing ifproxyisnull. The caller still has to pass the builtrequestConfigtoHttpClientBuilder.setDefaultRequestConfig(RequestConfig).- Parameters:
proxy- the proxy, may benullrequestConfig- the request configuration to set the proxy host onclientBuilder- the client builder to set credentials and the route planner on
-