Top Description Fields Constructors Methods
org.eclipse.jgit.transport

public Class ChainingCredentialsProvider

extends CredentialsProvider
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .List, org.eclipse.jgit.errors.UnsupportedCredentialItem

A credentials provider chaining multiple credentials providers
Since
3.5

Field Summary

Modifier and TypeField and Description
private List<CredentialsProvider>

Constructor Summary

AccessConstructor and Description
public
ChainingCredentialsProvider(CredentialsProvider...
credential providers asked for credentials in the order given here
providers
)

Create a new chaining credential provider.

Method Summary

Modifier and TypeMethod and Description
public boolean
get(URIish
the URI of the remote resource that needs authentication.
uri
,
CredentialItem...
the items the application requires to complete authentication.
items
)

Implements abstract org.eclipse.jgit.transport.CredentialsProvider.get.

Ask for the credential items to be populated.

public boolean
isInteractive()

Implements abstract org.eclipse.jgit.transport.CredentialsProvider.isInteractive.

Check if the provider is interactive with the end-user.

public boolean
supports(CredentialItem...
the items the application requires to complete authentication.
items
)

Implements abstract org.eclipse.jgit.transport.CredentialsProvider.supports.

Check if the provider can supply the necessary org.eclipse.jgit.transport.CredentialItems.

Inherited from org.eclipse.jgit.transport.CredentialsProvider:
getgetDefaultisAnyNullresetsetDefault

Field Detail

credentialProvidersback to summary
private List<CredentialsProvider> credentialProviders

Constructor Detail

ChainingCredentialsProviderback to summary
public ChainingCredentialsProvider(CredentialsProvider... providers)

Create a new chaining credential provider. This provider tries to retrieve credentials from the chained credential providers in the order they are given here. If multiple providers support the requested items and have non-null credentials the first of them will be used.

Parameters
providers:CredentialsProvider[]

credential providers asked for credentials in the order given here

Method Detail

getback to summary
public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem

Implements abstract org.eclipse.jgit.transport.CredentialsProvider.get.

Doc from org.eclipse.jgit.transport.CredentialsProvider.get.

Ask for the credential items to be populated.

Populates the credential items with the credentials provided by the first credential provider in the list which populates them with non-null values

Parameters
uri:URIish

the URI of the remote resource that needs authentication.

items:CredentialItem[]

the items the application requires to complete authentication.

Returns:boolean

true if the request was successful and values were supplied; false if the user canceled the request and did not supply all requested values.

Annotations
@Override
Exceptions
UnsupportedCredentialItem:
if one of the items supplied is not supported.
See Also
org.eclipse.jgit.transport.CredentialsProvider#supports(org.eclipse.jgit.transport.CredentialItem[])
isInteractiveback to summary
public boolean isInteractive()

Implements abstract org.eclipse.jgit.transport.CredentialsProvider.isInteractive.

Doc from org.eclipse.jgit.transport.CredentialsProvider.isInteractive.

Check if the provider is interactive with the end-user. An interactive provider may try to open a dialog box, or prompt for input on the terminal, and will wait for a user response. A non-interactive provider will either populate CredentialItems, or fail.

Returns:boolean

true if the provider is interactive with the end-user.

Annotations
@Override
supportsback to summary
public boolean supports(CredentialItem... items)

Implements abstract org.eclipse.jgit.transport.CredentialsProvider.supports.

Doc from org.eclipse.jgit.transport.CredentialsProvider.supports.

Check if the provider can supply the necessary org.eclipse.jgit.transport.CredentialItems.

Parameters
items:CredentialItem[]

the items the application requires to complete authentication.

Returns:boolean

true if this org.eclipse.jgit.transport.CredentialsProvider supports all of the items supplied.

Annotations
@Override