public class FtpRemoteFileTemplate extends RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile>
RemoteFileTemplate
providing type-safe access to
the underlying FTPClient object.sessionFactory
Constructor and Description |
---|
FtpRemoteFileTemplate(SessionFactory<org.apache.commons.net.ftp.FTPFile> sessionFactory) |
Modifier and Type | Method and Description |
---|---|
protected <T> T |
doExecuteWithClient(ClientCallback<org.apache.commons.net.ftp.FTPClient,T> callback) |
<T,C> T |
executeWithClient(ClientCallback<C,T> callback)
Execute the callback's doWithClient method after obtaining a session's
client, providing access to low level methods.
|
boolean |
exists(String path)
Check if a file exists on the remote server.
|
afterPropertiesSet, append, append, execute, get, get, getRemoteFileSeparator, getSessionFactory, getTemporaryFileSuffix, isUseTemporaryFileName, remove, rename, send, send, setAutoCreateDirectory, setBeanFactory, setCharset, setFileNameExpression, setFileNameGenerator, setRemoteDirectoryExpression, setRemoteFileSeparator, setTemporaryFileSuffix, setTemporaryRemoteDirectoryExpression, setUseTemporaryFileName
public FtpRemoteFileTemplate(SessionFactory<org.apache.commons.net.ftp.FTPFile> sessionFactory)
public <T,C> T executeWithClient(ClientCallback<C,T> callback)
RemoteFileOperations
executeWithClient
in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>
executeWithClient
in class RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile>
T
- The type returned by ClientCallback.doWithClient(Object)
.C
- The type of the underlying client object.callback
- the ClientCallback.protected <T> T doExecuteWithClient(ClientCallback<org.apache.commons.net.ftp.FTPClient,T> callback)
public boolean exists(String path)
RemoteFileOperations
exists
in interface RemoteFileOperations<org.apache.commons.net.ftp.FTPFile>
exists
in class RemoteFileTemplate<org.apache.commons.net.ftp.FTPFile>
path
- The full path to the file.