public abstract class AbstractFtpSessionFactory<T extends org.apache.commons.net.ftp.FTPClient> extends java.lang.Object implements SessionFactory<org.apache.commons.net.ftp.FTPFile>
Modifier and Type | Field and Description |
---|---|
protected int |
bufferSize |
protected int |
clientMode |
protected org.apache.commons.net.ftp.FTPClientConfig |
config |
protected java.lang.String |
controlEncoding |
static java.lang.String |
DEFAULT_REMOTE_WORKING_DIRECTORY |
protected int |
fileType |
protected java.lang.String |
host |
protected java.lang.String |
password |
protected int |
port |
protected java.lang.String |
username |
Constructor and Description |
---|
AbstractFtpSessionFactory() |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
createClientInstance() |
Session<org.apache.commons.net.ftp.FTPFile> |
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 |
setControlEncoding(java.lang.String controlEncoding) |
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(java.lang.String host) |
void |
setPassword(java.lang.String pass) |
void |
setPort(int port) |
void |
setUsername(java.lang.String user) |
public static final java.lang.String DEFAULT_REMOTE_WORKING_DIRECTORY
protected org.apache.commons.net.ftp.FTPClientConfig config
protected java.lang.String username
protected java.lang.String host
protected java.lang.String password
protected int port
protected int bufferSize
protected int clientMode
protected int fileType
protected java.lang.String controlEncoding
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
- public void setControlEncoding(java.lang.String controlEncoding)
public void setConfig(org.apache.commons.net.ftp.FTPClientConfig config)
public void setBufferSize(int bufferSize)
public void setHost(java.lang.String host)
public void setPort(int port)
public void setUsername(java.lang.String user)
public void setPassword(java.lang.String pass)
public void setClientMode(int clientMode)
public Session<org.apache.commons.net.ftp.FTPFile> getSession()
getSession
in interface SessionFactory<org.apache.commons.net.ftp.FTPFile>
protected abstract T createClientInstance()
protected void postProcessClientAfterConnect(T t) throws java.io.IOException
java.io.IOException
protected void postProcessClientBeforeConnect(T client) throws java.io.IOException
java.io.IOException