List of usage examples for org.eclipse.jgit.transport CredentialItem.StringType getPromptText
public String getPromptText()
From source file:org.jboss.arquillian.container.openshift.auth.ArquillianConfigurationCredentialsProvider.java
License:Apache License
@Override public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem { if (configuration.get() == null) { throw new IllegalStateException("OpenShift Container configuration was not properly propagated"); }// w w w.j ava 2s .c o m if (items.length == 0) { return true; } for (CredentialItem item : items) { if (item instanceof CredentialItem.StringType) { CredentialItem.StringType i = (CredentialItem.StringType) item; i.setValue(getConfigurationValueByPrompt(i.getPromptText(), i.isValueSecure())); } else if (item instanceof CredentialItem.CharArrayType) { CredentialItem.CharArrayType i = (CredentialItem.CharArrayType) item; i.setValueNoCopy(getConfigurationValueByPrompt(i.getPromptText(), i.isValueSecure()).toCharArray()); } else { throw new UnsupportedCredentialItem(uri, item.getPromptText()); } } return true; }
From source file:org.jboss.arquillian.container.openshift.express.auth.ArquillianConfigurationCredentialsProvider.java
License:Apache License
@Override public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem { if (configuration.get() == null) { throw new IllegalStateException("OpenShift Express configuration was not properly propagated"); }/* w w w . j a v a 2s . c o m*/ if (items.length == 0) { return true; } for (CredentialItem item : items) { if (item instanceof CredentialItem.StringType) { CredentialItem.StringType i = (CredentialItem.StringType) item; i.setValue(getConfigurationValueByPrompt(i.getPromptText(), i.isValueSecure())); } else if (item instanceof CredentialItem.CharArrayType) { CredentialItem.CharArrayType i = (CredentialItem.CharArrayType) item; i.setValueNoCopy(getConfigurationValueByPrompt(i.getPromptText(), i.isValueSecure()).toCharArray()); } else { throw new UnsupportedCredentialItem(uri, item.getPromptText()); } } return true; }