org.eclipse.jgit.transport

## Class UsernamePasswordCredentialsProvider

- java.lang.Object
- - org.eclipse.jgit.transport.CredentialsProvider
  - - org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider

    public class UsernamePasswordCredentialsProvider
    extends CredentialsProvider

Simple `CredentialsProvider` that always uses the same information.

### Constructor Summary

Constructors
Constructor and Description
`UsernamePasswordCredentialsProvider(String username, char[] password)` Initialize the provider with a single username and password.
`UsernamePasswordCredentialsProvider(String username, String password)` Initialize the provider with a single username and password.

### Method Summary

Methods
`void` `clear()` Destroy the saved username and password..
`boolean` `get(URIish uri, CredentialItem... items)` Ask for the credential items to be populated.
`boolean` `isInteractive()` Check if the provider is interactive with the end-user.
`boolean` `supports(CredentialItem... items)` Check if the provider can supply the necessary `CredentialItem`s.

### Methods inherited from class org.eclipse.jgit.transport.CredentialsProvider

`get, getDefault, reset, setDefault`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### UsernamePasswordCredentialsProvider

    public UsernamePasswordCredentialsProvider(String username,
                                       String password)

Initialize the provider with a single username and password.

Parameters:
  `username` -
  `password` -

#### UsernamePasswordCredentialsProvider

    public UsernamePasswordCredentialsProvider(String username,
                                       char[] password)

Initialize the provider with a single username and password.

Parameters:
  `username` -
  `password` -

### Method Detail

#### isInteractive

    public boolean isInteractive()

Description copied from class: `CredentialsProvider`
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.

Specified by:
  `isInteractive` in class `CredentialsProvider`
Returns:
  `true` if the provider is interactive with the end-user.

#### supports

    public boolean supports(CredentialItem... items)

Description copied from class: `CredentialsProvider`
Check if the provider can supply the necessary `CredentialItem`s.

Specified by:
  `supports` in class `CredentialsProvider`
Parameters:
  `items` - the items the application requires to complete authentication.
Returns:
  `true` if this `CredentialsProvider` supports all of the items supplied.

#### get

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

Description copied from class: `CredentialsProvider`
Ask for the credential items to be populated.

Specified by:
  `get` in class `CredentialsProvider`
Parameters:
  `uri` - the URI of the remote resource that needs authentication.
  `items` - the items the application requires to complete authentication.
Returns:
  `true` if the request was successful and values were supplied; `false` if the user canceled the request and did not supply all requested values.
Throws:
  `UnsupportedCredentialItem` - if one of the items supplied is not supported.

#### clear

    public void clear()

Destroy the saved username and password..