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

public Class UsernamePasswordCredentialsProvider

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

Simple org.eclipse.jgit.transport.CredentialsProvider that always uses the same information.

Field Summary

Modifier and TypeField and Description
private char[]
private String

Constructor Summary

AccessConstructor and Description
public
UsernamePasswordCredentialsProvider(String
user name
username
,
String
password
password
)

Initialize the provider with a single username and password.

public
UsernamePasswordCredentialsProvider(String
user name
username
,
char[]
password
password
)

Initialize the provider with a single username and password.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Destroy the saved username and password..

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

passwordback to summary
private char[] password
usernameback to summary
private String username

Constructor Detail

UsernamePasswordCredentialsProviderback to summary
public UsernamePasswordCredentialsProvider(String username, String password)

Initialize the provider with a single username and password.

Parameters
username:String

user name

password:String

password

UsernamePasswordCredentialsProviderback to summary
public UsernamePasswordCredentialsProvider(String username, char[] password)

Initialize the provider with a single username and password.

Parameters
username:String

user name

password:char[]

password

Method Detail

clearback to summary
public void clear()

Destroy the saved username and password..

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.

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.
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