public static synchronized void setDefault (Authenticator a)

Sets the authenticator that will be used by the networking code when a proxy or an HTTP server asks for authentication.

First, if there is a security manager, its checkPermission method is called with a NetPermission("setDefaultAuthenticator") permission. This may result in a java.lang.SecurityException.

Parameters:
a    The authenticator to be set. If a is null then any previously set authenticator is removed.

Exceptions:
SecurityException     if a security manager exists and its checkPermission method doesn't allow setting the default authenticator.

See also:
SecurityManager.checkPermission, java.net.NetPermission