Package org.eclipse.jgit.util
Class CachedAuthenticator
- java.lang.Object
-
- java.net.Authenticator
-
- org.eclipse.jgit.util.CachedAuthenticator
-
- Direct Known Subclasses:
AwtAuthenticator
,ConsoleAuthenticator
public abstract class CachedAuthenticator extends java.net.Authenticator
Abstract authenticator which remembers prior authentications.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CachedAuthenticator.CachedAuthentication
Authentication data to remember and reuse.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Collection<CachedAuthenticator.CachedAuthentication>
cached
-
Constructor Summary
Constructors Constructor Description CachedAuthenticator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static void
add(CachedAuthenticator.CachedAuthentication ca)
Add a cached authentication for future use.protected java.net.PasswordAuthentication
getPasswordAuthentication()
protected abstract java.net.PasswordAuthentication
promptPasswordAuthentication()
Prompt for and request authentication from the end-user.-
Methods inherited from class java.net.Authenticator
getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefault
-
-
-
-
Field Detail
-
cached
private static final java.util.Collection<CachedAuthenticator.CachedAuthentication> cached
-
-
Method Detail
-
add
public static void add(CachedAuthenticator.CachedAuthentication ca)
Add a cached authentication for future use.- Parameters:
ca
- the information we should remember.
-
getPasswordAuthentication
protected final java.net.PasswordAuthentication getPasswordAuthentication()
- Overrides:
getPasswordAuthentication
in classjava.net.Authenticator
-
promptPasswordAuthentication
protected abstract java.net.PasswordAuthentication promptPasswordAuthentication()
Prompt for and request authentication from the end-user.- Returns:
- the authentication data; null if the user canceled the request and does not want to continue.
-
-