Class IvyAuthenticator


  • public final class IvyAuthenticator
    extends java.net.Authenticator
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.net.Authenticator

        java.net.Authenticator.RequestorType
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.net.Authenticator original  
      private static boolean securityWarningLogged  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private IvyAuthenticator​(java.net.Authenticator original)
      Private c'tor to prevent instantiation.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static java.net.Authenticator getCurrentAuthenticator()
      The Authenticator doesn't have API before Java 9 to get hold of the current system level Authenticator.
      private static java.net.Authenticator getDefaultAuthenticator()  
      private static int getJavaVersion()  
      protected java.net.PasswordAuthentication getPasswordAuthentication()  
      private static java.net.Authenticator getTheAuthenticator()  
      private static void handleReflectionException​(java.lang.Throwable t)  
      static void install()
      Installs an IvyAuthenticator as default Authenticator.
      private boolean isProxyAuthentication()
      Checks if the current authentication request is for the proxy server.
      • Methods inherited from class java.net.Authenticator

        getDefault, getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthenticationInstance, setDefault
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • original

        private java.net.Authenticator original
      • securityWarningLogged

        private static boolean securityWarningLogged
    • Constructor Detail

      • IvyAuthenticator

        private IvyAuthenticator​(java.net.Authenticator original)
        Private c'tor to prevent instantiation.
    • Method Detail

      • 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 java.net.PasswordAuthentication getPasswordAuthentication()
        Overrides:
        getPasswordAuthentication in class java.net.Authenticator
      • getCurrentAuthenticator

        static java.net.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 java.net.Authenticator getDefaultAuthenticator()
      • getTheAuthenticator

        private static java.net.Authenticator getTheAuthenticator()
      • handleReflectionException

        private static void handleReflectionException​(java.lang.Throwable t)
      • getJavaVersion

        private static int getJavaVersion()