public class ProxyUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PROXY_HOST
The host to use as proxy.
|
static String |
PROXY_NONPROXYHOSTS
A specification of non-proxy hosts.
|
static String |
PROXY_PASSWORD
The password to use for authentication for the proxy server.
|
static String |
PROXY_PORT
The port to use for the proxy.
|
static String |
PROXY_PROTOCOL
The protocol to use.
|
static String |
PROXY_USER
The username to use for authentication for the proxy server.
|
Constructor and Description |
---|
ProxyUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
avoidProxy(ProxyServer proxyServer,
Request request)
Checks whether proxy should be used according to nonProxyHosts settings of it, or we want to go directly to
target host.
|
static boolean |
avoidProxy(ProxyServer proxyServer,
String target)
Checks whether proxy should be used according to nonProxyHosts settings of it, or we want to go directly to
target host.
|
static ProxyServer |
createProxy(Properties properties)
Creates a proxy server instance from the given properties.
|
public static final String PROXY_HOST
public static final String PROXY_PORT
public static final String PROXY_PROTOCOL
ProxyServer.Protocol
enum.public static final String PROXY_NONPROXYHOSTS
public static final String PROXY_USER
public static final String PROXY_PASSWORD
public static boolean avoidProxy(ProxyServer proxyServer, Request request)
null
proxy is passed in, this method returns true -- since there is NO proxy, we
should avoid to use it. Simple hostname pattern matching using "*" are supported, but only as prefixes.
See http://download.oracle.com/javase/1.4.2/docs/guide/net/properties.htmlproxyServer
- request
- public static boolean avoidProxy(ProxyServer proxyServer, String target)
null
proxy is passed in, this method returns true -- since there is NO proxy, we
should avoid to use it. Simple hostname pattern matching using "*" are supported, but only as prefixes.
See http://download.oracle.com/javase/1.4.2/docs/guide/net/properties.htmlproxyServer
- target
- the hostnamepublic static ProxyServer createProxy(Properties properties)
properties
- the properties to evaluate. Must not be null.http://download.oracle.com/javase/1.4.2/docs/guide/net/properties.html
,
PROXY_HOST
,
PROXY_PORT
,
PROXY_PROTOCOL
,
PROXY_NONPROXYHOSTS
Copyright © 2015. All rights reserved.