public final class NetDefaults extends Object
Authenticator
, URLStreamHandlerFactory
)
used by the java.net package.
This class is thread-safe.
Modifier and Type | Method and Description |
---|---|
static Authenticator |
getAuthenticator()
Returns the authenticator specified using
setAuthenticator(java.net.Authenticator) . |
static URLStreamHandlerFactory |
getURLStreamHandlerFactory()
Returns the factory specified using
setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory) . |
static void |
initialize()
Initializes a number of system properties related to networking.
|
static void |
setAuthenticator(Authenticator a)
A cover for
Authenticator.setDefault(java.net.Authenticator) which allows to
use getAuthenticator() . |
static void |
setURLStreamHandlerFactory(URLStreamHandlerFactory f)
A cover for
URL.setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory) which allows to
use getURLStreamHandlerFactory() . |
public static void initialize()
public static void setAuthenticator(Authenticator a)
Authenticator.setDefault(java.net.Authenticator)
which allows to
use getAuthenticator()
.
May be used only once. Has no effect if invoked several times with different values.
public static Authenticator getAuthenticator()
setAuthenticator(java.net.Authenticator)
.
May return null
.public static void setURLStreamHandlerFactory(URLStreamHandlerFactory f)
URL.setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory)
which allows to
use getURLStreamHandlerFactory()
.
May be used only once. Has no effect if invoked several times with different values.
public static URLStreamHandlerFactory getURLStreamHandlerFactory()
setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory)
.
May return null
.