public class ProxyUtil extends Object
Constructor and Description |
---|
ProxyUtil() |
Modifier and Type | Method and Description |
---|---|
static URI |
getHostURI(URL url)
get the uri of the host with protocol and port for proxy selection
|
static List<Proxy> |
getProxiesWithLocal(URI uri)
same as ProxySelector.getDefault() but always ensure that local is first in the list
|
static boolean |
isUseSystemDefault(boolean use) |
static void |
setProxy(String proxy) |
static void |
setProxy(String proxy,
int port,
String user,
String pw)
setup the environment for proxies
|
static void |
setUseSystemDefault(boolean use) |
public static URI getHostURI(URL url)
url
- public static void setUseSystemDefault(boolean use)
use,
- if true use the system proxy propertiespublic static boolean isUseSystemDefault(boolean use)
use,
- if true use the system proxy propertiespublic static List<Proxy> getProxiesWithLocal(URI uri)
uri
- public static void setProxy(String proxy, int port, String user, 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(String proxy)
proxy
- Copyright © 2018. All rights reserved.