本文整理汇总了Java中org.eclipse.jgit.transport.CredentialItem.CharArrayType方法的典型用法代码示例。如果您正苦于以下问题:Java CredentialItem.CharArrayType方法的具体用法?Java CredentialItem.CharArrayType怎么用?Java CredentialItem.CharArrayType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.transport.CredentialItem
的用法示例。
在下文中一共展示了CredentialItem.CharArrayType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import org.eclipse.jgit.transport.CredentialItem; //导入方法依赖的package包/类
@Override
public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem {
for (CredentialItem ci : items) {
if (ci instanceof CredentialItem.YesNoType) {
handle((CredentialItem.YesNoType) ci);
} else if (ci instanceof CredentialItem.StringType) {
handle(uri, (CredentialItem.StringType) ci);
} else if (ci instanceof CredentialItem.CharArrayType) {
handle(uri, (CredentialItem.CharArrayType) ci);
} else {
return false;
}
}
return true;
}
示例2: handle
import org.eclipse.jgit.transport.CredentialItem; //导入方法依赖的package包/类
private void handle(URIish uri, CredentialItem.CharArrayType ci) {
if (ci instanceof CredentialItem.Password && uri.getPass() != null) {
ci.setValue(uri.getPass().toCharArray());
} else {
ci.setValue(blockingPrompt.request(prompt(String.class, uiNotificationFor(ci))).toCharArray());
}
}
示例3: apply
import org.eclipse.jgit.transport.CredentialItem; //导入方法依赖的package包/类
@Override
public Boolean apply(CredentialItem credentialItem) {
CredentialItem.CharArrayType casted = (CredentialItem.CharArrayType) credentialItem;
casted.setValue(readInput(credentialItem).toCharArray());
return true;
}
示例4: get
import org.eclipse.jgit.transport.CredentialItem; //导入方法依赖的package包/类
@Override
public boolean get(URIish urIish, CredentialItem... credentialItems) throws UnsupportedCredentialItem {
if (conversation == null) return false;
for (CredentialItem credentialItem : credentialItems) {
String message = ChatColor.GOLD + ">>> " + ChatColor.RESET + credentialItem.getPromptText();
if (credentialItem instanceof CredentialItem.InformationalMessage){
scheduler.runTask(plugin,new MessageSender(caller, message, callerWorkspaceName,0));
continue;
}
boolean wrongInput = false;
do {
String inputMessage;
synchronized (sync) {
lastInputMessage = null;
scheduler.runTask(plugin, new MessageSender(caller, message, callerWorkspaceName, 2));
awaitInput = true;
while (!finished && lastInputMessage == null) {
try {
sync.wait(1000);
if (conversation.getState().equals(ABANDONED)) {
finished = true;
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
awaitInput = false;
if (finished) return false;
inputMessage = lastInputMessage;
}
if (credentialItem instanceof CredentialItem.YesNoType) {
if (inputMessage.matches("yes|true|1|on|y|\\+|valid|correct|right")) {
((CredentialItem.YesNoType) credentialItem).setValue(true);
} else if (inputMessage.matches("no|false|n|0|-|invalid|incorrect|wrong")) {
((CredentialItem.YesNoType) credentialItem).setValue(false);
} else {
wrongInput = true;
}
} else if (credentialItem instanceof CredentialItem.StringType) {
((CredentialItem.StringType) credentialItem).setValue(inputMessage);
} else if (credentialItem instanceof CredentialItem.CharArrayType) {
((CredentialItem.CharArrayType) credentialItem).setValue(inputMessage.toCharArray());
}
} while (wrongInput);
}
return true;
}