Package org.kiwiproject.jsch
Class SftpConfig
- java.lang.Object
-
- org.kiwiproject.jsch.SftpConfig
-
public class SftpConfig extends Object
This (Dropwizard) config class allows for common configuration for SFTP access to remote hosts.One note on the
passwordandprivateKeyFilePathfields: the SFTP connector will use either the password or the private key but not both. If both are specified, the private key will take precedence. This allows for the greatest flexibility when connecting to different SFTP locations.- Implementation Note:
- This uses Dropwizard's
Durationand several Dropwizard validation annotations in addition to the standard Java Beans Validation annotations, so you will need to ensure the the appropriate Dropwizard JAR files are on the class/module path.
-
-
Constructor Summary
Constructors Constructor Description SftpConfig(int port, String host, String user, String password, String privateKeyFilePath, String preferredAuthentications, String remoteBasePath, String errorPath, String knownHostsFile, boolean disableStrictHostChecking, io.dropwizard.util.Duration timeout)All-args constructor.
-
-
-
Constructor Detail
-
SftpConfig
@ConstructorProperties({"port","host","user","password","privateKeyFilePath","preferredAuthentications","remoteBasePath","errorPath","knownHostsFile","disableStrictHostChecking","timeout"}) public SftpConfig(int port, String host, String user, String password, String privateKeyFilePath, String preferredAuthentications, String remoteBasePath, String errorPath, String knownHostsFile, boolean disableStrictHostChecking, io.dropwizard.util.Duration timeout)
All-args constructor.- Parameters:
port- the remote porthost- the remote hostuser- the SFTP usernamepassword- the SFTP passwordprivateKeyFilePath- path to private key filepreferredAuthentications- comma-separated list of authentications to attemptremoteBasePath- root directory of the remote SFTP locationerrorPath- local directory to write out any errors if SFTP failsknownHostsFile- path to the known hosts filedisableStrictHostChecking- if true, we will setStrictHostKeyChecking=notimeout- the SFTP connection timeout- Implementation Note:
- This is intentionally not using Lombok because using
AllArgsConstructortogether with @Builderresults in an all-args constructor that does not respectBuilder.Default. As a result we need to handle the defaults ourselves. This is intended to be used during deserialization from an external configuration file (e.g. a Dropwizard YAML configuration file, or from JSON). Prefer the builder when constructing programmatically.
-
-