Package org.eclipse.jgit.transport
Class CredentialItem
java.lang.Object
org.eclipse.jgit.transport.CredentialItem
- Direct Known Subclasses:
CredentialItem.CharArrayType,CredentialItem.InformationalMessage,CredentialItem.StringType,CredentialItem.YesNoType
A credential requested from a
CredentialsProvider.
Most users should work with the specialized subclasses:
CredentialItem.Usernamefor usernamesCredentialItem.Passwordfor passwordsCredentialItem.StringTypefor other general string informationCredentialItem.CharArrayTypefor other general secret information
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn item whose value is stored as a char[] and is therefore clearable.static classAn advice message presented to the user, with no response required.static classPrompt for a password, which is masked on input.static classAn item whose value is stored as a string.static classPrompt for a username, which is not masked on input.static classAn item whose value is a boolean choice, presented as Yes/No. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidclear()Clear the stored value, destroying it as much as possible.Get prompt to display to the user.booleanWhether the value should be masked when entered.
-
Field Details
-
promptText
-
valueSecure
private final boolean valueSecure
-
-
Constructor Details
-
CredentialItem
Initialize a prompt.- Parameters:
promptText- prompt to display to the user alongside of the input field. Should be sufficient text to indicate what to supply for this item.maskValue- true if the value should be masked from displaying during input. This should be true for passwords and other secrets, false for names and other public data.
-
-
Method Details
-
getPromptText
Get prompt to display to the user.- Returns:
- prompt to display to the user.
-
isValueSecure
public boolean isValueSecure()Whether the value should be masked when entered.- Returns:
- true if the value should be masked when entered.
-
clear
public abstract void clear()Clear the stored value, destroying it as much as possible.
-