Class HttpClientProxy

java.lang.Object
org.codehaus.mojo.license.utils.HttpClientProxy

public final class HttpClientProxy extends Object
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 Type
    Method
    Description
    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.
    static org.apache.maven.settings.Proxy
    findActiveProxy(Collection<org.apache.maven.settings.Proxy> proxies)
    Finds the proxy to use among the proxies declared in settings.xml.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 in settings.xml.
      Parameters:
      proxies - the declared proxies, may be null
      Returns:
      the first active http proxy, or null if 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 if proxy is null. The caller still has to pass the built requestConfig to HttpClientBuilder.setDefaultRequestConfig(RequestConfig).
      Parameters:
      proxy - the proxy, may be null
      requestConfig - the request configuration to set the proxy host on
      clientBuilder - the client builder to set credentials and the route planner on