Class IvyAuthenticator

java.lang.Object
java.net.Authenticator
org.apache.ivy.util.url.IvyAuthenticator

public final class IvyAuthenticator extends Authenticator
  • Field Details

    • original

      private Authenticator original
    • securityWarningLogged

      private static boolean securityWarningLogged
  • Constructor Details

    • IvyAuthenticator

      private IvyAuthenticator(Authenticator original)
      Private c'tor to prevent instantiation.
  • Method Details

    • install

      public static void install()
      Installs an IvyAuthenticator as default Authenticator. Call this method before opening HTTP(S) connections to enable Ivy authentication.
    • getPasswordAuthentication

      protected PasswordAuthentication getPasswordAuthentication()
      Overrides:
      getPasswordAuthentication in class Authenticator
    • getCurrentAuthenticator

      static Authenticator getCurrentAuthenticator()
      The Authenticator doesn't have API before Java 9 to get hold of the current system level Authenticator. This method does a best-effort attempt to try and get hold of the current Authenticator in a way that's specific to the implementation of this method. There's no guarantee that this method will return the current authenticator. Note: this method is intended to be used exclusively by tests.
      Returns:
      Returns the currently setup system level Authenticator. In cases where this method isn't able to get the current authenticator, this method returns null
    • isProxyAuthentication

      private boolean isProxyAuthentication()
      Checks if the current authentication request is for the proxy server.
    • getDefaultAuthenticator

      private static Authenticator getDefaultAuthenticator()
    • getTheAuthenticator

      private static Authenticator getTheAuthenticator()
    • handleReflectionException

      private static void handleReflectionException(Throwable t)
    • getJavaVersion

      private static int getJavaVersion()