Package org.apache.ivy.util.url
Class IvyAuthenticator
java.lang.Object
java.net.Authenticator
org.apache.ivy.util.url.IvyAuthenticator
-
Nested Class Summary
Nested classes/interfaces inherited from class java.net.Authenticator
Authenticator.RequestorType -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateIvyAuthenticator(Authenticator original) Private c'tor to prevent instantiation. -
Method Summary
Modifier and TypeMethodDescription(package private) static AuthenticatorTheAuthenticatordoesn't have API before Java 9 to get hold of the current system levelAuthenticator.private static Authenticatorprivate static intprotected PasswordAuthenticationprivate static Authenticatorprivate static voidstatic voidinstall()Installs an IvyAuthenticator as default Authenticator.private booleanChecks if the current authentication request is for the proxy server.Methods inherited from class java.net.Authenticator
getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefault
-
Field Details
-
original
-
securityWarningLogged
private static boolean securityWarningLogged
-
-
Constructor Details
-
IvyAuthenticator
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
- Overrides:
getPasswordAuthenticationin classAuthenticator
-
getCurrentAuthenticator
TheAuthenticatordoesn't have API before Java 9 to get hold of the current system levelAuthenticator. This method does a best-effort attempt to try and get hold of the currentAuthenticatorin 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
-
getTheAuthenticator
-
handleReflectionException
-
getJavaVersion
private static int getJavaVersion()
-