public class FtpRemoteFileTemplate
extends org.springframework.integration.file.remote.RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile>
RemoteFileTemplate providing type-safe access to
the underlying FTPClient object.| Modifier and Type | Class and Description |
|---|---|
static class |
FtpRemoteFileTemplate.ExistsMode
The
exists(String) operation mode. |
| Constructor and Description |
|---|
FtpRemoteFileTemplate(org.springframework.integration.file.remote.session.SessionFactory<org.apache.commons.net.ftp.FTPFile> sessionFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected <T> T |
doExecuteWithClient(org.springframework.integration.file.remote.ClientCallback<org.apache.commons.net.ftp.FTPClient,T> callback) |
<T,C> T |
executeWithClient(org.springframework.integration.file.remote.ClientCallback<C,T> callback) |
boolean |
exists(java.lang.String path)
This particular FTP implementation is based on the
FTPClient.getStatus(String)
by default, but since not all FTP servers properly implement the STAT command,
the framework internal FtpRemoteFileTemplate instances are switched to the
FTPClient.listNames(String) for only files operations. |
void |
setExistsMode(FtpRemoteFileTemplate.ExistsMode existsMode)
Specify an
FtpRemoteFileTemplate.ExistsMode for exists(String) operation. |
afterPropertiesSet, append, append, execute, get, get, getRemoteFileSeparator, getSession, getSessionFactory, getTemporaryFileSuffix, invoke, isUseTemporaryFileName, list, remove, rename, send, send, setAutoCreateDirectory, setBeanFactory, setCharset, setFileNameExpression, setFileNameGenerator, setRemoteDirectoryExpression, setRemoteFileSeparator, setTemporaryFileSuffix, setTemporaryRemoteDirectoryExpression, setUseTemporaryFileNamepublic FtpRemoteFileTemplate(org.springframework.integration.file.remote.session.SessionFactory<org.apache.commons.net.ftp.FTPFile> sessionFactory)
public <T,C> T executeWithClient(org.springframework.integration.file.remote.ClientCallback<C,T> callback)
executeWithClient in interface org.springframework.integration.file.remote.RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>executeWithClient in class org.springframework.integration.file.remote.RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile>public void setExistsMode(FtpRemoteFileTemplate.ExistsMode existsMode)
FtpRemoteFileTemplate.ExistsMode for exists(String) operation.
Defaults to FtpRemoteFileTemplate.ExistsMode.STAT.
When used internally by framework components for file operation,
switched to FtpRemoteFileTemplate.ExistsMode.NLST.existsMode - the FtpRemoteFileTemplate.ExistsMode to use.protected <T> T doExecuteWithClient(org.springframework.integration.file.remote.ClientCallback<org.apache.commons.net.ftp.FTPClient,T> callback)
public boolean exists(java.lang.String path)
FTPClient.getStatus(String)
by default, but since not all FTP servers properly implement the STAT command,
the framework internal FtpRemoteFileTemplate instances are switched to the
FTPClient.listNames(String) for only files operations.
The mode can be switched with the setExistsMode(ExistsMode) property.
Any custom implementation can be done in an extension of the FtpRemoteFileTemplate.
exists in interface org.springframework.integration.file.remote.RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>exists in class org.springframework.integration.file.remote.RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile>path - the remote file path to check.