Search in sources :

Example 1 with PerHostConfigBuilder

use of com.adaptris.sftp.PerHostConfigBuilder in project interlok by adaptris.

the class SftpExampleHelper method createPerHostConfigRepo.

public static PerHostConfigBuilder createPerHostConfigRepo() {
    PerHostConfigBuilder inline = new PerHostConfigBuilder();
    HostConfig a = new HostConfig("my.host.com", null, -1, new KeyValuePair("StrictHostKeyChecking", "yes"), new KeyValuePair(SftpClient.SSH_PREFERRED_AUTHENTICATIONS, SftpClient.NO_KERBEROS_AUTH));
    HostConfig b = new HostConfig("another.host.com", null, -1, new KeyValuePair("StrictHostKeyChecking", "no"), new KeyValuePair(SftpClient.SSH_PREFERRED_AUTHENTICATIONS, SftpClient.NO_KERBEROS_AUTH));
    inline.getHosts().add(a);
    inline.getHosts().add(b);
    return inline;
}
Also used : KeyValuePair(com.adaptris.util.KeyValuePair) HostConfig(com.adaptris.sftp.HostConfig) PerHostConfigBuilder(com.adaptris.sftp.PerHostConfigBuilder)

Example 2 with PerHostConfigBuilder

use of com.adaptris.sftp.PerHostConfigBuilder in project interlok by adaptris.

the class PerHostConfigRepositoryBuilder method build.

@Override
public ConfigBuilder build() {
    PerHostConfigBuilder repo = new PerHostConfigBuilder();
    repo.getDefaultConfiguration().addAll(config());
    for (String host : knownHosts) {
        HostConfig cfg = new HostConfig();
        cfg.setHostname(host);
        cfg.getConfig().addAll(config());
        repo.getHosts().add(cfg);
    }
    return repo;
}
Also used : HostConfig(com.adaptris.sftp.HostConfig) PerHostConfigBuilder(com.adaptris.sftp.PerHostConfigBuilder)

Aggregations

HostConfig (com.adaptris.sftp.HostConfig)2 PerHostConfigBuilder (com.adaptris.sftp.PerHostConfigBuilder)2 KeyValuePair (com.adaptris.util.KeyValuePair)1