Package org.eclipse.jgit.console
Class ConsoleCredentialsProvider
- java.lang.Object
-
- org.eclipse.jgit.transport.CredentialsProvider
-
- org.eclipse.jgit.console.ConsoleCredentialsProvider
-
public class ConsoleCredentialsProvider extends CredentialsProvider
Interacts with the user during authentication by using the text console.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.Consolecons
-
Constructor Summary
Constructors Constructor Description ConsoleCredentialsProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanget(CredentialItem.CharArrayType item)private booleanget(CredentialItem.InformationalMessage item)private booleanget(CredentialItem.StringType item)private booleanget(CredentialItem.YesNoType item)booleanget(URIish uri, CredentialItem... items)Ask for the credential items to be populated.static voidinstall()Install this implementation as the default.booleanisInteractive()Check if the provider is interactive with the end-user.booleansupports(CredentialItem... items)Check if the provider can supply the necessaryCredentialItems.-
Methods inherited from class org.eclipse.jgit.transport.CredentialsProvider
get, getDefault, isAnyNull, reset, setDefault
-
-
-
-
Method Detail
-
install
public static void install()
Install this implementation as the default.
-
isInteractive
public boolean 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.- Specified by:
isInteractivein classCredentialsProvider- Returns:
trueif the provider is interactive with the end-user.
-
supports
public boolean supports(CredentialItem... items)
Check if the provider can supply the necessaryCredentialItems.- Specified by:
supportsin classCredentialsProvider- Parameters:
items- the items the application requires to complete authentication.- Returns:
trueif thisCredentialsProvidersupports all of the items supplied.
-
get
public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem
Ask for the credential items to be populated.- Specified by:
getin classCredentialsProvider- Parameters:
uri- the URI of the remote resource that needs authentication.items- the items the application requires to complete authentication.- Returns:
trueif the request was successful and values were supplied;falseif the user canceled the request and did not supply all requested values.- Throws:
UnsupportedCredentialItem- if one of the items supplied is not supported.
-
get
private boolean get(CredentialItem.StringType item)
-
get
private boolean get(CredentialItem.CharArrayType item)
-
get
private boolean get(CredentialItem.InformationalMessage item)
-
get
private boolean get(CredentialItem.YesNoType item)
-
-