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;
}
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;
}
Aggregations