Class AbstractFtpSessionFactory<T extends org.apache.commons.net.ftp.FTPClient>
java.lang.Object
org.springframework.integration.ftp.session.AbstractFtpSessionFactory<T>
- Type Parameters:
T- TheFTPClienttype
- 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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
AbstractFtpSessionFactory
public AbstractFtpSessionFactory()
-
-
Method Details
-
setFileType
public void setFileType(int fileType) File types defined byFTPconstants:FTP.ASCII_FILE_TYPEFTP.EBCDIC_FILE_TYPEFTP.BINARY_FILE_TYPE(DEFAULT)FTP.LOCAL_FILE_TYPE
- Parameters:
fileType- The file type.
-
setControlEncoding
-
setConfig
public void setConfig(org.apache.commons.net.ftp.FTPClientConfig config) -
setBufferSize
public void setBufferSize(int bufferSize) -
setHost
-
setPort
public void setPort(int port) -
setUsername
-
setPassword
-
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.- Parameters:
clientMode- The client mode.
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout) Set the connect timeout for the socket.- Parameters:
connectTimeout- the timeout
-
setDefaultTimeout
public void setDefaultTimeout(int defaultTimeout) Set the (socket option) timeout on the command socket.- Parameters:
defaultTimeout- the timeout.
-
setDataTimeout
public void setDataTimeout(int dataTimeout) Set the (socket option) timeout on the data connection.- Parameters:
dataTimeout- the timeout.
-
getSession
- Specified by:
getSessionin interfaceSessionFactory<T extends org.apache.commons.net.ftp.FTPClient>
-
createClientInstance
-
postProcessClientAfterConnect
Will 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
-
postProcessClientBeforeConnect
Will handle additional initialization before client.connect() method was invoked.- Parameters:
client- The client.- Throws:
IOException- Any IOException.
-