Class AbstractFtpSessionFactory<T extends org.apache.commons.net.ftp.FTPClient>
java.lang.Object
org.springframework.integration.ftp.session.AbstractFtpSessionFactory<T>
- Type Parameters:
- T- The- FTPClienttype
- All Implemented Interfaces:
- SessionFactory<org.apache.commons.net.ftp.FTPFile>
- Direct Known Subclasses:
- DefaultFtpSessionFactory,- DefaultFtpsSessionFactory
public abstract class AbstractFtpSessionFactory<T extends org.apache.commons.net.ftp.FTPClient>
extends Object
implements SessionFactory<org.apache.commons.net.ftp.FTPFile>
Base class for FTP SessionFactory implementations.
- Since:
- 2.0
- Author:
- Iwein Fuld, Mark Fisher, Oleg Zhurakousky
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract Tprotected voidWill handle additional initialization after client.connect() method was invoked, but before any action on the client has been taken.protected voidpostProcessClientBeforeConnect(T client) Will handle additional initialization before client.connect() method was invoked.voidsetBufferSize(int bufferSize) voidsetClientMode(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.voidsetConfig(org.apache.commons.net.ftp.FTPClientConfig config) voidsetConnectTimeout(int connectTimeout) Set the connect timeout for the socket.voidsetControlEncoding(String controlEncoding) voidsetDataTimeout(int dataTimeout) Set the (socket option) timeout on the data connection.voidsetDefaultTimeout(int defaultTimeout) Set the (socket option) timeout on the command socket.voidsetFileType(int fileType) File types defined byFTPconstants:FTP.ASCII_FILE_TYPEFTP.EBCDIC_FILE_TYPEFTP.BINARY_FILE_TYPE(DEFAULT)FTP.LOCAL_FILE_TYPE.voidvoidsetPassword(String pass) voidsetPort(int port) voidsetUsername(String user) 
- 
Field Details- 
logger
 
- 
- 
Constructor Details- 
AbstractFtpSessionFactorypublic AbstractFtpSessionFactory()
 
- 
- 
Method Details- 
setFileTypepublic void setFileType(int fileType) File types defined byFTPconstants:- FTP.ASCII_FILE_TYPE
- FTP.EBCDIC_FILE_TYPE
- FTP.BINARY_FILE_TYPE(DEFAULT)
- FTP.LOCAL_FILE_TYPE
 - Parameters:
- fileType- The file type.
 
- 
setControlEncoding
- 
setConfigpublic void setConfig(org.apache.commons.net.ftp.FTPClientConfig config) 
- 
setBufferSizepublic void setBufferSize(int bufferSize) 
- 
setHost
- 
setPortpublic void setPort(int port) 
- 
setUsername
- 
setPassword
- 
setClientModepublic 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.- Parameters:
- clientMode- The client mode.
 
- 
setConnectTimeoutpublic void setConnectTimeout(int connectTimeout) Set the connect timeout for the socket.- Parameters:
- connectTimeout- the timeout
 
- 
setDefaultTimeoutpublic void setDefaultTimeout(int defaultTimeout) Set the (socket option) timeout on the command socket.- Parameters:
- defaultTimeout- the timeout.
 
- 
setDataTimeoutpublic void setDataTimeout(int dataTimeout) Set the (socket option) timeout on the data connection.- Parameters:
- dataTimeout- the timeout.
 
- 
getSession- Specified by:
- getSessionin interface- SessionFactory<T extends org.apache.commons.net.ftp.FTPClient>
 
- 
createClientInstance
- 
postProcessClientAfterConnectWill handle additional initialization after client.connect() method was invoked, but before any action on the client has been taken.- Parameters:
- t- The client.
- Throws:
- IOException- Any IOException
 
- 
postProcessClientBeforeConnectWill handle additional initialization before client.connect() method was invoked.- Parameters:
- client- The client.
- Throws:
- IOException- Any IOException.
 
 
-