Class AdapterResourceAuthenticator


  • public class AdapterResourceAuthenticator
    extends java.net.Authenticator
    Responsible for authenticating against network resources when requested.

    This calls Authenticator.setDefault(Authenticator) in a static block; when authentication is required, this will iterate over the list of configured ResourceAuthenticator instances and return the first non-null PasswordAuthentication provided.

    Classes that wish to provide an Authenticator instance are encouraged to instead implement ResourceAuthenticator and add to this instance using the addAuthenticator(ResourceAuthenticator) and removeAuthenticator(ResourceAuthenticator) methods.

    • Method Detail

      • getPasswordAuthentication

        protected java.net.PasswordAuthentication getPasswordAuthentication()
        Overrides:
        getPasswordAuthentication in class java.net.Authenticator
      • currentAuthenticators

        public java.util.Collection<ResourceAuthenticator> currentAuthenticators()
        Return a cloned list of the current set of configured authenticators.
        Returns:
        a shallow clone of the current set of authenticators.