org.springframework.integration.ftp.session
Class AbstractFtpSessionFactory<T extends org.apache.commons.net.ftp.FTPClient>
java.lang.Object
org.springframework.integration.ftp.session.AbstractFtpSessionFactory<T>
- All Implemented Interfaces:
- SessionFactory
- Direct Known Subclasses:
- DefaultFtpSessionFactory, DefaultFtpsSessionFactory
public abstract class AbstractFtpSessionFactory<T extends org.apache.commons.net.ftp.FTPClient>
- extends java.lang.Object
- implements SessionFactory
Base class for FTP SessionFactory implementations.
- Since:
- 2.0
Method Summary |
protected void |
afterConnect(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 abstract T |
createClientInstance()
|
Session |
getSession()
|
protected void |
postProcessClient(T t)
|
void |
setClientMode(int clientMode)
ACTIVE_LOCAL_DATA_CONNECTION_MODE = 0
A constant indicating the FTP session is expecting all transfers
to occur between the client (local) and server and that the server
should connect to the client's data port to initiate a data transfer. |
void |
setConfig(org.apache.commons.net.ftp.FTPClientConfig config)
|
void |
setFileType(int fileType)
File types defined by FTP constants. |
void |
setHost(java.lang.String host)
|
void |
setPassword(java.lang.String pass)
|
void |
setPort(int port)
|
void |
setRemoteWorkingDirectory(java.lang.String remoteWorkingDirectory)
|
void |
setUsername(java.lang.String user)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_REMOTE_WORKING_DIRECTORY
public static final java.lang.String DEFAULT_REMOTE_WORKING_DIRECTORY
- See Also:
- Constant Field Values
config
protected org.apache.commons.net.ftp.FTPClientConfig config
username
protected java.lang.String username
host
protected java.lang.String host
password
protected java.lang.String password
port
protected int port
remoteWorkingDirectory
protected java.lang.String remoteWorkingDirectory
clientMode
protected int clientMode
fileType
protected int fileType
AbstractFtpSessionFactory
public AbstractFtpSessionFactory()
setFileType
public void setFileType(int fileType)
- File types defined by
FTP
constants.
ASCII_FILE_TYPE=0;
EBCDIC_FILE_TYPE=1;
BINARY_FILE_TYPE=3 (DEFAULT);
LOCAL_FILE_TYPE=4;
- Parameters:
fileType
-
setConfig
public void setConfig(org.apache.commons.net.ftp.FTPClientConfig config)
setHost
public void setHost(java.lang.String host)
setPort
public void setPort(int port)
setUsername
public void setUsername(java.lang.String user)
setPassword
public void setPassword(java.lang.String pass)
setRemoteWorkingDirectory
public void setRemoteWorkingDirectory(java.lang.String remoteWorkingDirectory)
setClientMode
public void setClientMode(int clientMode)
- ACTIVE_LOCAL_DATA_CONNECTION_MODE = 0
A constant indicating the FTP session is expecting all transfers
to occur between the client (local) and server and that the server
should connect to the client's data port to initiate a data transfer.
This is the default data connection mode when and FTPClient instance
is created.
PASSIVE_LOCAL_DATA_CONNECTION_MODE = 2
A constant indicating the FTP session is expecting all transfers
to occur between the client (local) and server and that the server
is in passive mode, requiring the client to connect to the
server's data port to initiate a transfer.
getSession
public Session getSession()
- Specified by:
getSession
in interface SessionFactory
createClientInstance
protected abstract T createClientInstance()
afterConnect
protected void afterConnect(T t)
throws java.io.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:
java.io.IOException
- if anything should go wrong
postProcessClient
protected void postProcessClient(T t)
throws java.io.IOException
- Throws:
java.io.IOException