Class SftpConfiguration

java.lang.Object
org.apache.camel.component.file.GenericFileConfiguration
org.apache.camel.component.file.remote.RemoteFileConfiguration
org.apache.camel.component.file.remote.SftpConfiguration

@UriParams public class SftpConfiguration extends RemoteFileConfiguration
Secure FTP configuration
  • Field Details

  • Constructor Details

    • SftpConfiguration

      public SftpConfiguration()
    • SftpConfiguration

      public SftpConfiguration(URI uri)
  • Method Details

    • setDefaultPort

      protected void setDefaultPort()
      Specified by:
      setDefaultPort in class RemoteFileConfiguration
    • getKnownHostsFile

      public String getKnownHostsFile()
    • setKnownHostsFile

      public void setKnownHostsFile(String knownHostsFile)
      Sets the known_hosts file, so that the SFTP endpoint can do host key verification.
    • getKnownHostsUri

      public String getKnownHostsUri()
    • isUseUserKnownHostsFile

      public boolean isUseUserKnownHostsFile()
    • setUseUserKnownHostsFile

      public void setUseUserKnownHostsFile(boolean useUserKnownHostsFile)
      If knownHostFile has not been explicit configured then use the host file from System.getProperty(user.home)/.ssh/known_hosts
    • isAutoCreateKnownHostsFile

      public boolean isAutoCreateKnownHostsFile()
    • setAutoCreateKnownHostsFile

      public void setAutoCreateKnownHostsFile(boolean autoCreateKnownHostsFile)
      If knownHostFile does not exist, then attempt to auto-create the path and file (beware that the file will be created by the current user of the running Java process, which may not have file permission).
    • setKnownHostsUri

      public void setKnownHostsUri(String knownHostsUri)
      Sets the known_hosts file (loaded from classpath by default), so that the SFTP endpoint can do host key verification.
    • getKnownHosts

      public byte[] getKnownHosts()
    • setKnownHosts

      public void setKnownHosts(byte[] knownHosts)
      Sets the known_hosts from the byte array, so that the SFTP endpoint can do host key verification.
    • getPrivateKeyFile

      public String getPrivateKeyFile()
    • setPrivateKeyFile

      public void setPrivateKeyFile(String privateKeyFile)
      Set the private key file so that the SFTP endpoint can do private key verification.
    • getPrivateKeyUri

      public String getPrivateKeyUri()
    • setPrivateKeyUri

      public void setPrivateKeyUri(String privateKeyUri)
      Set the private key file (loaded from classpath by default) so that the SFTP endpoint can do private key verification.
    • getPrivateKey

      public byte[] getPrivateKey()
    • setPrivateKey

      public void setPrivateKey(byte[] privateKey)
      Set the private key as byte[] so that the SFTP endpoint can do private key verification.
    • getPrivateKeyPassphrase

      public String getPrivateKeyPassphrase()
    • setPrivateKeyPassphrase

      public void setPrivateKeyPassphrase(String privateKeyFilePassphrase)
      Set the private key file passphrase so that the SFTP endpoint can do private key verification.
    • getPrivateKeyFilePassphrase

      @Deprecated public String getPrivateKeyFilePassphrase()
      Deprecated.
    • setPrivateKeyFilePassphrase

      @Deprecated public void setPrivateKeyFilePassphrase(String privateKeyFilePassphrase)
      Deprecated.
    • getKeyPair

      public KeyPair getKeyPair()
    • setKeyPair

      public void setKeyPair(KeyPair keyPair)
      Sets a key pair of the public and private key so to that the SFTP endpoint can do public/private key verification.
    • getStrictHostKeyChecking

      public String getStrictHostKeyChecking()
    • setStrictHostKeyChecking

      public void setStrictHostKeyChecking(String strictHostKeyChecking)
      Sets whether to use strict host key checking.
    • setServerAliveInterval

      public void setServerAliveInterval(int serverAliveInterval)
      Sets the interval (millis) to send a keep-alive message. If zero is specified, any keep-alive message must not be sent. The default interval is zero.
    • getServerAliveInterval

      public int getServerAliveInterval()
    • setServerAliveCountMax

      public void setServerAliveCountMax(int serverAliveCountMax)
      Sets the number of keep-alive messages which may be sent without receiving any messages back from the server. If this threshold is reached while keep-alive messages are being sent, the connection will be disconnected. The default value is one.
    • getServerAliveCountMax

      public int getServerAliveCountMax()
    • setChmod

      public void setChmod(String chmod)
      Allows you to set chmod on the stored file. For example chmod=640.
    • getChmod

      public String getChmod()
    • setChmodDirectory

      public void setChmodDirectory(String chmodDirectory)
      Allows you to set chmod during path creation. For example chmod=640.
    • getChmodDirectory

      public String getChmodDirectory()
    • setCiphers

      public void setCiphers(String ciphers)
      Set a comma separated list of ciphers that will be used in order of preference. Possible cipher names are defined by JCraft JSCH. Some examples include: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc. If not specified the default list from JSCH will be used.
    • getCiphers

      public String getCiphers()
    • getCompression

      public int getCompression()
    • setCompression

      public void setCompression(int compression)
      To use compression. Specify a level from 1 to 10. Important: You must manually add the needed JSCH zlib JAR to the classpath for compression support.
    • setPreferredAuthentications

      public void setPreferredAuthentications(String pAuthentications)
      Set the preferred authentications which SFTP endpoint will used. Some example include:password,publickey. If not specified the default list from JSCH will be used.
    • getPreferredAuthentications

      public String getPreferredAuthentications()
    • getJschLoggingLevel

      public org.apache.camel.LoggingLevel getJschLoggingLevel()
    • setJschLoggingLevel

      public void setJschLoggingLevel(org.apache.camel.LoggingLevel jschLoggingLevel)
      The logging level to use for JSCH activity logging. As JSCH is verbose at by default at INFO level the threshold is WARN by default.
    • setBulkRequests

      public void setBulkRequests(Integer bulkRequests)
      Specifies how many requests may be outstanding at any one time. Increasing this value may slightly improve file transfer speed but will increase memory usage.
    • getBulkRequests

      public Integer getBulkRequests()
    • setBindAddress

      public void setBindAddress(String bindAddress)
      Specifies the address of the local interface against which the connection should bind.
    • getBindAddress

      public String getBindAddress()
    • isExistDirCheckUsingLs

      public boolean isExistDirCheckUsingLs()
    • setExistDirCheckUsingLs

      public void setExistDirCheckUsingLs(boolean existDirCheckUsingLs)
      Whether to check for existing directory using LS command or CD. By default LS is used which is safer as otherwise Camel needs to change the directory back after checking. However LS has been reported to cause a problem on windows system in some situations and therefore you can disable this option to use CD.
    • getKeyExchangeProtocols

      public String getKeyExchangeProtocols()
    • setKeyExchangeProtocols

      public void setKeyExchangeProtocols(String keyExchangeProtocols)
      Set a comma separated list of key exchange protocols that will be used in order of preference. Possible cipher names are defined by JCraft JSCH. Some examples include: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1, diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521. If not specified the default list from JSCH will be used.
    • getServerHostKeys

      public String getServerHostKeys()
    • setServerHostKeys

      public void setServerHostKeys(String serverHostKeys)
      Set a comma separated list of algorithms supported for the server host key. Some examples include: ssh-dss,ssh-rsa,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521. If not specified the default list from JSCH will be used.
    • getPublicKeyAcceptedAlgorithms

      public String getPublicKeyAcceptedAlgorithms()
    • setPublicKeyAcceptedAlgorithms

      public void setPublicKeyAcceptedAlgorithms(String publicKeyAcceptedAlgorithms)
      Set a comma separated list of public key accepted algorithms. Some examples include: ssh-dss,ssh-rsa,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521. If not specified the default list from JSCH will be used.
    • getFilenameEncoding

      public String getFilenameEncoding()
    • setFilenameEncoding

      public void setFilenameEncoding(String filenameEncoding)
      Encoding to use for FTP client when parsing filenames. By default, UTF-8 is used.
    • getServerMessageLoggingLevel

      public org.apache.camel.LoggingLevel getServerMessageLoggingLevel()
    • setServerMessageLoggingLevel

      public void setServerMessageLoggingLevel(org.apache.camel.LoggingLevel serverMessageLoggingLevel)
      The logging level used for various human intended log messages from the FTP server. This can be used during troubleshooting to raise the logging level and inspect the logs received from the FTP server.