Java 类com.jcraft.jsch.agentproxy.connector.SSHAgentConnector 实例源码

项目:cyberduck    文件:OpenSSHAgentAuthenticator.java   
@Override
public Collection<Identity> getIdentities() {
    if(!SSHAgentConnector.isConnectorAvailable()) {
        log.warn(String.format("SSH agent %s is not running", this));
        return Collections.emptyList();
    }
    if(null == proxy) {
        return Collections.emptyList();
    }
    if(log.isDebugEnabled()) {
        log.debug(String.format("Retrieve identities from proxy %s", proxy));
    }
    final List<Identity> identities = Arrays.asList(proxy.getIdentities());
    if(log.isDebugEnabled()) {
        log.debug(String.format("Found %d identities", identities.size()));
    }
    return identities;
}
项目:cyberduck    文件:OpenSSHAgentAuthenticator.java   
public OpenSSHAgentAuthenticator() {
    try {
        proxy = new AgentProxy(new SSHAgentConnector(new JNAUSocketFactory()));
    }
    catch(AgentProxyException e) {
        log.warn(String.format("Agent proxy %s failed with %s", this, e));
    }
}