Class SftpConfig.SftpConfigBuilder

java.lang.Object
org.kiwiproject.jsch.SftpConfig.SftpConfigBuilder
Enclosing class:
SftpConfig

public static class SftpConfig.SftpConfigBuilder extends Object
  • Method Details

    • port

      public SftpConfig.SftpConfigBuilder port(int port)
      The SFTP port. Default is 22.
      Returns:
      this.
    • host

      The remote host to connect to via SFTP.
      Returns:
      this.
    • user

      The remote user to connect with via SFTP.
      Returns:
      this.
    • password

      public SftpConfig.SftpConfigBuilder password(String password)
      The password, only used if password authentication is used.
      Returns:
      this.
    • privateKeyFilePath

      public SftpConfig.SftpConfigBuilder privateKeyFilePath(String privateKeyFilePath)
      The path to the private key file, only used if public key authentication is used.
      Returns:
      this.
    • preferredAuthentications

      public SftpConfig.SftpConfigBuilder preferredAuthentications(String preferredAuthentications)
      The comma-separated list of preferred authentication mechanisms. Equivalent to the -o PreferredAuthentications=[gssapi-with-mic|hostbased|publickey|keyboard-interactive|password] option.

      The default is publickey,password which differs from the default order in the SFTP command. See the ssh_info man page for details.

      Returns:
      this.
    • remoteBasePath

      public SftpConfig.SftpConfigBuilder remoteBasePath(String remoteBasePath)
      The root directory of the remote SFTP location, provided as a convenience to store the remote path in the same place as the other SFTP properties.

      It is not required nor currently used by SftpConnector or SftpTransfers.

      Returns:
      this.
    • errorPath

      public SftpConfig.SftpConfigBuilder errorPath(String errorPath)
      The local directory to write out any errors if SFTP fails.
      Returns:
      this.
    • knownHostsFile

      public SftpConfig.SftpConfigBuilder knownHostsFile(String knownHostsFile)
      The path to the known hosts file.
      Returns:
      this.
    • disableStrictHostChecking

      public SftpConfig.SftpConfigBuilder disableStrictHostChecking(boolean disableStrictHostChecking)
      Provides option to disable strict host key checking, equivalent to the -o StrictHostKeyChecking=[yes|no] option.

      The default is false. See the ssh_info man page for more details.

      Returns:
      this.
    • timeout

      public SftpConfig.SftpConfigBuilder timeout(io.dropwizard.util.Duration timeout)
      SFTP connection timeout. Default is 5 seconds.
      Returns:
      this.
      Implementation Note:
      The minimum duration annotation of 50 milliseconds is somewhat arbitrary, and is really just intended to ensure a positive value.
    • build

      public SftpConfig build()
    • toString

      public String toString()
      Overrides:
      toString in class Object