Package org.cip4.jdflib.util.net
Class ProxyUtil
- java.lang.Object
-
- org.cip4.jdflib.util.net.ProxyUtil
-
public class ProxyUtil extends java.lang.Objectinternal proxy handler
-
-
Constructor Summary
Constructors Constructor Description ProxyUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.net.URIgetHostURI(java.net.URL url)get the uri of the host with protocol and port for proxy selectionstatic java.util.List<java.net.Proxy>getProxiesWithLocal(java.net.URI uri)same as ProxySelector.getDefault() but always ensure that local is first in the liststatic java.net.ProxygetProxy(java.lang.String url)static booleanisUseSystemDefault(boolean use)static voidsetProxy(java.lang.String proxy)static voidsetProxy(java.lang.String proxy, int port, java.lang.String user, java.lang.String pw)setup the environment for proxiesstatic voidsetUseSystemDefault(boolean use)
-
-
-
Method Detail
-
getHostURI
public static java.net.URI getHostURI(java.net.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 java.util.List<java.net.Proxy> getProxiesWithLocal(java.net.URI uri)
same as ProxySelector.getDefault() but always ensure that local is first in the list- Parameters:
uri-- Returns:
-
setProxy
public static void setProxy(java.lang.String proxy, int port, java.lang.String user, java.lang.String pw)setup the environment for proxies- Parameters:
proxy- the proxy url - NO PORT!port- the proxy portuser- the user for authentication, if null no authentication is attemptedpw- the pass word for authentication
-
setProxy
public static void setProxy(java.lang.String proxy)
- Parameters:
proxy-
-
getProxy
public static java.net.Proxy getProxy(java.lang.String url)
-
-