Spring Integration

org.springframework.integration.ftp
Class AbstractFtpClientFactory<T extends org.apache.commons.net.ftp.FTPClient>

java.lang.Object
  extended by org.springframework.integration.ftp.AbstractFtpClientFactory<T>
All Implemented Interfaces:
FtpClientFactory<T>
Direct Known Subclasses:
DefaultFtpClientFactory, DefaultFtpsClientFactory

public abstract class AbstractFtpClientFactory<T extends org.apache.commons.net.ftp.FTPClient>
extends Object
implements FtpClientFactory<T>


Field Summary
protected  int clientMode
           
protected  org.apache.commons.net.ftp.FTPClientConfig config
           
protected  int fileType
           
protected  String host
           
protected  String password
           
protected  int port
           
protected  String remoteWorkingDirectory
           
protected  String username
           
 
Constructor Summary
AbstractFtpClientFactory()
           
 
Method Summary
protected abstract  T createSingleInstanceOfClient()
           
 T getClient()
           
protected  void onAfterConnect(T t)
          this is a hook to setup the state of the FTPClient impl *after* the implementation's SocketClient.connect(String) method's been called but before any action's been taken.
protected  void setClientMode(org.apache.commons.net.ftp.FTPClient client)
          Sets the mode of the connection.
 void setClientMode(int clientMode)
          Set client mode for example FTPClient.ACTIVE_LOCAL_CONNECTION_MODE (default) Only local modes are supported.
 void setConfig(org.apache.commons.net.ftp.FTPClientConfig config)
           
 void setFileType(int fileType)
           
 void setHost(String host)
           
 void setPassword(String pass)
           
 void setPort(int port)
           
 void setRemoteWorkingDirectory(String remoteWorkingDirectory)
           
 void setUsername(String user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected org.apache.commons.net.ftp.FTPClientConfig config

username

protected String username

host

protected String host

password

protected String password

port

protected int port

remoteWorkingDirectory

protected String remoteWorkingDirectory

clientMode

protected int clientMode

fileType

protected int fileType
Constructor Detail

AbstractFtpClientFactory

public AbstractFtpClientFactory()
Method Detail

setFileType

public void setFileType(int fileType)

setConfig

public void setConfig(org.apache.commons.net.ftp.FTPClientConfig config)

setHost

public void setHost(String host)

setPort

public void setPort(int port)

setUsername

public void setUsername(String user)

setPassword

public void setPassword(String pass)

setRemoteWorkingDirectory

public void setRemoteWorkingDirectory(String remoteWorkingDirectory)

setClientMode

public void setClientMode(int clientMode)
Set client mode for example FTPClient.ACTIVE_LOCAL_CONNECTION_MODE (default) Only local modes are supported.


createSingleInstanceOfClient

protected abstract T createSingleInstanceOfClient()

onAfterConnect

protected void onAfterConnect(T t)
                       throws IOException
this is a hook to setup the state of the FTPClient impl *after* the implementation's SocketClient.connect(String) method's been called but before any action's been taken.

Parameters:
t - the ftp client instance on which to act
Throws:
IOException - if anything should go wrong

getClient

public T getClient()
                                                         throws SocketException,
                                                                IOException
Specified by:
getClient in interface FtpClientFactory<T extends org.apache.commons.net.ftp.FTPClient>
Returns:
Fully configured and connected FTPClient. Never null.
Throws:
IOException - thrown when a networking IO subsystem error occurs
SocketException

setClientMode

protected void setClientMode(org.apache.commons.net.ftp.FTPClient client)
Sets the mode of the connection. Only local modes are supported.


Spring Integration

Copyright © 2010. All Rights Reserved.