Class ProxyUtil

java.lang.Object
org.cip4.jdflib.util.net.ProxyUtil

public class ProxyUtil extends Object
internal proxy handler
  • Constructor Details

    • ProxyUtil

      public ProxyUtil()
  • Method Details

    • getHostURI

      public static URI getHostURI(URL url)
      get the uri of the host with protocol and port for proxy selection
      Parameters:
      url -
      Returns:
    • setUseSystemDefault

      public static void setUseSystemDefault(boolean use)
      Parameters:
      use - , if true use the system proxy properties
    • isUseSystemDefault

      public static boolean isUseSystemDefault(boolean use)
      Parameters:
      use - , the default if not set
      Returns:
      if true use the system proxy properties
    • getProxiesWithLocal

      public static List<Proxy> getProxiesWithLocal(URI uri)
      same as ProxySelector.getDefault() but always ensure that local is first in the list
      Parameters:
      uri -
      Returns:
    • setProxy

      public static void setProxy(String proxy, int port, String user, String pw)
      setup the environment for proxies
      Parameters:
      proxy - the proxy url - NO PORT!
      port - the proxy port
      user - the user for authentication, if null no authentication is attempted
      pw - the pass word for authentication
    • setProxy

      public static void setProxy(String proxy)
      Parameters:
      proxy -
    • getProxy

      public static Proxy getProxy(String url)