public abstract class CredentialsProvider extends Object
CredentialItem.Username and
CredentialItem.Password items. More
sophisticated implementors may implement additional types, such as
CredentialItem.StringType.
CredentialItems are usually presented in bulk, allowing implementors to
combine them into a single UI widget and streamline the authentication
process for an end-user.UsernamePasswordCredentialsProvider| Constructor and Description |
|---|
CredentialsProvider() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
get(URIish uri,
CredentialItem... items)
Ask for the credential items to be populated.
|
boolean |
get(URIish uri,
List<CredentialItem> items)
Ask for the credential items to be populated.
|
static CredentialsProvider |
getDefault()
Get the default credentials provider, or null.
|
protected static boolean |
isAnyNull(CredentialItem... items)
Whether any of the passed items is null
|
abstract boolean |
isInteractive()
Check if the provider is interactive with the end-user.
|
void |
reset(URIish uri)
Reset the credentials provider for the given URI
|
static void |
setDefault(CredentialsProvider p)
Set the default credentials provider.
|
abstract boolean |
supports(CredentialItem... items)
Check if the provider can supply the necessary
CredentialItems. |
public static CredentialsProvider getDefault()
public static void setDefault(CredentialsProvider p)
p - the new default provider, may be null to select no default.protected static boolean isAnyNull(CredentialItem... items)
items - credential items to checktrue if any of the passed items is null, false
otherwisepublic abstract boolean isInteractive()
true if the provider is interactive with the end-user.public abstract boolean supports(CredentialItem... items)
CredentialItems.items - the items the application requires to complete authentication.true if this
CredentialsProvider supports
all of the items supplied.public abstract boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem
uri - the URI of the remote resource that needs authentication.items - the items the application requires to complete authentication.true if the request was successful and values were
supplied; false if the user canceled the request and did
not supply all requested values.UnsupportedCredentialItem - if one of the items supplied is not supported.public boolean get(URIish uri, List<CredentialItem> items) throws UnsupportedCredentialItem
uri - the URI of the remote resource that needs authentication.items - the items the application requires to complete authentication.true if the request was successful and values were
supplied; false if the user canceled the request and did
not supply all requested values.UnsupportedCredentialItem - if one of the items supplied is not supported.Copyright © 2021 Eclipse JGit Project. All rights reserved.