public class ProxyUtil
extends java.lang.Object
| Constructor and Description |
|---|
ProxyUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.net.URI |
getHostURI(java.net.URL url)
get the uri of the host with protocol and port for proxy selection
|
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
|
static boolean |
isUseSystemDefault(boolean use) |
static void |
setProxy(java.lang.String proxy) |
static void |
setProxy(java.lang.String proxy,
int port,
java.lang.String user,
java.lang.String pw)
setup the environment for proxies
|
static void |
setUseSystemDefault(boolean use) |
public static java.net.URI getHostURI(java.net.URL url)
url - public static void setUseSystemDefault(boolean use)
use, - if true use the system proxy propertiespublic static boolean isUseSystemDefault(boolean use)
use, - the default if not setpublic static java.util.List<java.net.Proxy> getProxiesWithLocal(java.net.URI uri)
uri - public static void setProxy(java.lang.String proxy,
int port,
java.lang.String user,
java.lang.String pw)
proxy - the proxy url - NO PORT!port - the proxy portuser - the user for authentication, if null no authentication is attemptedpw - the pass word for authenticationpublic static void setProxy(java.lang.String proxy)
proxy -