public abstract class AbstractFtpSessionFactory<T extends org.apache.commons.net.ftp.FTPClient> extends Object implements SessionFactory<org.apache.commons.net.ftp.FTPFile>
Constructor and Description |
---|
AbstractFtpSessionFactory() |
Modifier and Type | Method and 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 taken
|
protected 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 by
FTP 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) |
protected final Log logger
public void setFileType(int fileType)
FTP
constants:
FTP.ASCII_FILE_TYPE
FTP.EBCDIC_FILE_TYPE
FTP.BINARY_FILE_TYPE
(DEFAULT)FTP.LOCAL_FILE_TYPE
fileType
- The file type.public void setControlEncoding(String controlEncoding)
public void setConfig(org.apache.commons.net.ftp.FTPClientConfig config)
public void setBufferSize(int bufferSize)
public void setHost(String host)
public void setPort(int port)
public void setUsername(String user)
public void setPassword(String pass)
public void setClientMode(int clientMode)
clientMode
- The client mode.public void setConnectTimeout(int connectTimeout)
connectTimeout
- the timeoutpublic void setDefaultTimeout(int defaultTimeout)
defaultTimeout
- the timeout.public void setDataTimeout(int dataTimeout)
dataTimeout
- the timeout.public FtpSession getSession()
getSession
in interface SessionFactory<org.apache.commons.net.ftp.FTPFile>
protected abstract T createClientInstance()
protected void postProcessClientAfterConnect(T t) throws IOException
t
- The client.IOException
- Any IOExceptionprotected void postProcessClientBeforeConnect(T client) throws IOException
client
- The client.IOException
- Any IOException.