Spring Integration

org.springframework.integration.sftp.config
Class SftpSessionUtils

java.lang.Object
  extended by org.springframework.integration.sftp.config.SftpSessionUtils

public class SftpSessionUtils
extends Object

Provides a single place to handle this tedious chore.

Author:
Josh Long

Constructor Summary
SftpSessionUtils()
           
 
Method Summary
static SftpSessionFactory buildSftpSessionFactory(String host, String pw, String usr, String pvKey, String pvKeyPass, int port)
          This method hides the minutae required to build an #SftpSessionFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SftpSessionUtils

public SftpSessionUtils()
Method Detail

buildSftpSessionFactory

public static SftpSessionFactory buildSftpSessionFactory(String host,
                                                         String pw,
                                                         String usr,
                                                         String pvKey,
                                                         String pvKeyPass,
                                                         int port)
                                                  throws Exception
This method hides the minutae required to build an #SftpSessionFactory.

Parameters:
host - the host to connect to.
usr - this is required. It is the username of the credentials being authenticated.
pw - if password authentication is being used (as opposed to key-based authentication) then this is where you configure the password.
pvKey - the file that is the private key
pvKeyPass - the passphrase used to use the key file
port - the default (22) is used if the value here is N< 0. The value should be only be set if the port is non-standard (not 22)
Returns:
the SftpSessionFactory that's used to create connections and get us in the right state to start issue commands against a remote SFTP/SSH filesystem
Throws:
Exception - thrown in case of darned near anything

Spring Integration

Copyright © 2010. All Rights Reserved.