Package org.openstreetmap.josm.io
Class DefaultProxySelector
java.lang.Object
java.net.ProxySelector
org.openstreetmap.josm.io.DefaultProxySelector
This is the default proxy selector used in JOSM.
- Since:
- 2641
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ProxySelectorprivate InetSocketAddressprivate static final Stringprivate static final Stringprivate static booleanTheProxySelectorprovided by the JDK will retrieve proxy information from the system settings, if the system propertyjava.net.useSystemProxiesis defined at startup.static final StringProperty key for proxy exceptions liststatic final StringProperty key for HTTP proxy hoststatic final StringProperty key for HTTP proxy portstatic final StringProperty key for hosts that should be proxied (if this is set, only specified hosts should be proxied)static final StringProperty key for proxy passwordstatic final StringProperty key for proxy policystatic final StringProperty key for SOCKS proxy hoststatic final StringProperty key for SOCKS proxy portstatic final StringProperty key for proxy usernameprivate ProxyPolicyprivate InetSocketAddress -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidClear the sets of failed resources and error messages.voidconnectFailed(URI uri, SocketAddress sa, IOException ioe) Returns the set of current proxy error messages.Returns the set of current proxy resources that failed to be retrieved.final booleanDetermines if proxy errors have occurred.final voidInitializes the proxy selector from the setting in the preferences.protected intparseProxyPortValue(String property, String value) static booleanTheProxySelectorprovided by the JDK will retrieve proxy information from the system settings, if the system propertyjava.net.useSystemProxiesis defined at startup.Methods inherited from class java.net.ProxySelector
getDefault, of, setDefault
-
Field Details
-
PROXY_POLICY
Property key for proxy policy- See Also:
-
PROXY_HTTP_HOST
Property key for HTTP proxy host- See Also:
-
PROXY_HTTP_PORT
Property key for HTTP proxy port- See Also:
-
PROXY_SOCKS_HOST
Property key for SOCKS proxy host- See Also:
-
PROXY_SOCKS_PORT
Property key for SOCKS proxy port- See Also:
-
PROXY_USER
Property key for proxy username- See Also:
-
PROXY_PASS
Property key for proxy password- See Also:
-
PROXY_EXCEPTIONS
Property key for proxy exceptions list- See Also:
-
PROXY_INCLUDES
Property key for hosts that should be proxied (if this is set, only specified hosts should be proxied)- Since:
- 18663
- See Also:
-
NO_PROXY_LIST
-
IPV4_LOOPBACK
- See Also:
-
IPV6_LOOPBACK
- See Also:
-
jvmWillUseSystemProxies
TheProxySelectorprovided by the JDK will retrieve proxy information from the system settings, if the system propertyjava.net.useSystemProxiesis defined at startup. It has no effect if the property is set later by the application.We therefore read the property at class loading time and remember its value.
-
proxyPolicy
-
httpProxySocketAddress
-
socksProxySocketAddress
-
delegate
-
errorResources
-
errorMessages
-
proxyExceptions
-
proxyIncludes
-
-
Constructor Details
-
DefaultProxySelector
A typical example is:PropertySelector delegate = PropertySelector.getDefault(); PropertySelector.setDefault(new DefaultPropertySelector(delegate));- Parameters:
delegate- the proxy selector to delegate to if system settings are used. Usually this is the proxy selector found by ProxySelector.getDefault() before this proxy selector is installed
-
-
Method Details
-
willJvmRetrieveSystemProxies
TheProxySelectorprovided by the JDK will retrieve proxy information from the system settings, if the system propertyjava.net.useSystemProxiesis defined at startup. If the property is set later by the application, this has no effect.- Returns:
- true, if
java.net.useSystemProxieswas set to true at class initialization time
-
parseProxyPortValue
-
initFromPreferences
Initializes the proxy selector from the setting in the preferences. -
connectFailed
- Specified by:
connectFailedin classProxySelector
-
getErrorResources
Returns the set of current proxy resources that failed to be retrieved.- Returns:
- the set of current proxy resources that failed to be retrieved
- Since:
- 6523
-
getErrorMessages
Returns the set of current proxy error messages.- Returns:
- the set of current proxy error messages
- Since:
- 6523
-
clearErrors
Clear the sets of failed resources and error messages.- Since:
- 6523
-
hasErrors
Determines if proxy errors have occurred.- Returns:
trueif errors have occurred,falseotherwise.- Since:
- 6523
-
select
- Specified by:
selectin classProxySelector
-