Class SftpRemoteFileTemplate
java.lang.Object
org.springframework.integration.file.remote.RemoteFileTemplate<org.apache.sshd.sftp.client.SftpClient.DirEntry>
org.springframework.integration.sftp.session.SftpRemoteFileTemplate
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,InitializingBean
,RemoteFileOperations<org.apache.sshd.sftp.client.SftpClient.DirEntry>
public class SftpRemoteFileTemplate
extends RemoteFileTemplate<org.apache.sshd.sftp.client.SftpClient.DirEntry>
SFTP version of
RemoteFileTemplate
providing type-safe access to
the underlying ChannelSftp object.- Since:
- 4.1
- Author:
- Gary Russell, Artem Bilan
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.file.remote.RemoteFileOperations
RemoteFileOperations.OperationsCallback<F,
T> -
Field Summary
Fields inherited from class org.springframework.integration.file.remote.RemoteFileTemplate
logger, sessionFactory
-
Constructor Summary
ConstructorDescriptionSftpRemoteFileTemplate
(SessionFactory<org.apache.sshd.sftp.client.SftpClient.DirEntry> sessionFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> T
doExecuteWithClient
(ClientCallback<org.apache.sshd.sftp.client.SftpClient, 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.Methods inherited from class org.springframework.integration.file.remote.RemoteFileTemplate
afterPropertiesSet, append, append, execute, exists, get, get, getDirectoryExpressionProcessor, getRemoteFileSeparator, getSession, getSessionFactory, getTemporaryFileSuffix, invoke, isUseTemporaryFileName, list, remove, rename, send, send, setAutoCreateDirectory, setBeanFactory, setCharset, setFileNameExpression, setFileNameGenerator, setRemoteDirectoryExpression, setRemoteFileSeparator, setTemporaryFileSuffix, setTemporaryRemoteDirectoryExpression, setUseTemporaryFileName
-
Constructor Details
-
SftpRemoteFileTemplate
public SftpRemoteFileTemplate(SessionFactory<org.apache.sshd.sftp.client.SftpClient.DirEntry> sessionFactory)
-
-
Method Details
-
executeWithClient
Description copied from interface:RemoteFileOperations
Execute the callback's doWithClient method after obtaining a session's client, providing access to low level methods. Reliably closes the session when the method exits.- Specified by:
executeWithClient
in interfaceRemoteFileOperations<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Overrides:
executeWithClient
in classRemoteFileTemplate<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Type Parameters:
T
- The type returned byClientCallback.doWithClient(Object)
.C
- The type of the underlying client object.- Parameters:
callback
- the ClientCallback.- Returns:
- The result of the callback method.
-
doExecuteWithClient
protected <T> T doExecuteWithClient(ClientCallback<org.apache.sshd.sftp.client.SftpClient, T> callback)
-