当前位置: 首页>>代码示例>>Java>>正文


Java CredentialItem.CharArrayType方法代码示例

本文整理汇总了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;
}
 
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:16,代码来源:GUICredentialsProvider.java

示例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());
    }
}
 
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:8,代码来源:GUICredentialsProvider.java

示例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;
}
 
开发者ID:nyrkovalex,项目名称:get.me,代码行数:7,代码来源:CredentialHandlers.java

示例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;
}
 
开发者ID:DPOH-VAR,项目名称:VarScript,代码行数:49,代码来源:GitExecutor.java


注:本文中的org.eclipse.jgit.transport.CredentialItem.CharArrayType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。