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

public Class NetRCCredentialsProvider

extends CredentialsProvider
Class Inheritance
Imports
org.eclipse.jgit.errors.UnsupportedCredentialItem, org.eclipse.jgit.transport.NetRC.NetRCEntry

Simple .netrc credentials provider. It can lookup the first machine entry from your .netrc file.
Since
3.5

Field Summary

Modifier and TypeField and Description
pack-priv NetRC

Constructor Summary

AccessConstructor and Description
public
NetRCCredentialsProvider()

Constructor for NetRCCredentialsProvider.

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 static void
install()

Install default provider for the .netrc parser.

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

netrcback to summary
pack-priv NetRC netrc

Constructor Detail

NetRCCredentialsProviderback to summary
public NetRCCredentialsProvider()

Constructor for NetRCCredentialsProvider.

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.

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.
installback to summary
public static void install()

Install default provider for the .netrc parser.

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