org.springframework.integration.ftp
Class AbstractFtpClientFactory<T extends org.apache.commons.net.ftp.FTPClient>
java.lang.Object
org.springframework.integration.ftp.AbstractFtpClientFactory<T>
- All Implemented Interfaces:
- FtpClientFactory<T>
- Direct Known Subclasses:
- DefaultFtpClientFactory, DefaultFtpsClientFactory
public abstract class AbstractFtpClientFactory<T extends org.apache.commons.net.ftp.FTPClient>
- extends Object
- implements FtpClientFactory<T>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
config
protected org.apache.commons.net.ftp.FTPClientConfig config
username
protected String username
host
protected String host
password
protected String password
port
protected int port
remoteWorkingDirectory
protected String remoteWorkingDirectory
clientMode
protected int clientMode
fileType
protected int fileType
AbstractFtpClientFactory
public AbstractFtpClientFactory()
setFileType
public void setFileType(int fileType)
setConfig
public void setConfig(org.apache.commons.net.ftp.FTPClientConfig config)
setHost
public void setHost(String host)
setPort
public void setPort(int port)
setUsername
public void setUsername(String user)
setPassword
public void setPassword(String pass)
setRemoteWorkingDirectory
public void setRemoteWorkingDirectory(String remoteWorkingDirectory)
setClientMode
public void setClientMode(int clientMode)
- Set client mode for example
FTPClient.ACTIVE_LOCAL_CONNECTION_MODE
(default) Only local
modes are supported.
createSingleInstanceOfClient
protected abstract T createSingleInstanceOfClient()
onAfterConnect
protected void onAfterConnect(T t)
throws IOException
- this is a hook to setup the state of the
FTPClient
impl *after* the
implementation's SocketClient.connect(String)
method's been called but before any
action's been taken.
- Parameters:
t
- the ftp client instance on which to act
- Throws:
IOException
- if anything should go wrong
getClient
public T getClient()
throws SocketException,
IOException
- Specified by:
getClient
in interface FtpClientFactory<T extends org.apache.commons.net.ftp.FTPClient>
- Returns:
- Fully configured and connected FTPClient. Never
null
.
- Throws:
IOException
- thrown when a networking IO subsystem error occurs
SocketException
setClientMode
protected void setClientMode(org.apache.commons.net.ftp.FTPClient client)
- Sets the mode of the connection. Only local modes are supported.
Copyright © 2010. All Rights Reserved.