Class AbstractFtpSessionFactory<T extends org.apache.commons.net.ftp.FTPClient>
java.lang.Object
org.springframework.integration.ftp.session.AbstractFtpSessionFactory<T>
- 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
-
Constructor Summary
Constructors Constructor Description AbstractFtpSessionFactory()
-
Method Summary
Modifier and Type Method Description protected abstract T
createClientInstance()
FtpSession
getSession()
protected void
postProcessClientAfterConnect(T t)
Will handle additional initialization after client.connect() method was invoked, but before any action on the client has been takenprotected void
postProcessClientBeforeConnect(T client)
Will handle additional initialization before client.connect() method was invoked.void
setBufferSize(int bufferSize)
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
setConnectTimeout(int connectTimeout)
Set the connect timeout for the socket.void
setControlEncoding(String controlEncoding)
void
setDataTimeout(int dataTimeout)
Set the (socket option) timeout on the data connection.void
setDefaultTimeout(int defaultTimeout)
Set the (socket option) timeout on the command socket.void
setFileType(int fileType)
File types defined byFTP
constants:FTP.ASCII_FILE_TYPE
FTP.EBCDIC_FILE_TYPE
FTP.BINARY_FILE_TYPE
(DEFAULT)FTP.LOCAL_FILE_TYPE
void
setHost(String host)
void
setPassword(String pass)
void
setPort(int port)
void
setUsername(String user)
-
Field Details
-
Constructor Details
-
AbstractFtpSessionFactory
public AbstractFtpSessionFactory()
-
-
Method Details
-
setFileType
public void setFileType(int fileType)File types defined byFTP
constants:FTP.ASCII_FILE_TYPE
FTP.EBCDIC_FILE_TYPE
FTP.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:
getSession
in 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.
-