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 SummaryNested classes/interfaces inherited from interface org.springframework.integration.file.remote.RemoteFileOperationsRemoteFileOperations.OperationsCallback<F,T> 
- 
Field SummaryFieldsFields inherited from class org.springframework.integration.file.remote.RemoteFileTemplatelogger, sessionFactory
- 
Constructor SummaryConstructorsConstructorDescriptionSftpRemoteFileTemplate(SessionFactory<org.apache.sshd.sftp.client.SftpClient.DirEntry> sessionFactory) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected <T> TdoExecuteWithClient(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.protected booleanisStatusDirty(int status) Check ifSftpException.getStatus()is treated as fatal.protected booleanDetermine whetherSession.dirty()should be called in theRemoteFileTemplate.execute(SessionCallback)when an exception is thrown from the callback.Methods inherited from class org.springframework.integration.file.remote.RemoteFileTemplateafterPropertiesSet, 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
- 
Field Details- 
NOT_DIRTY_STATUSES
 
- 
- 
Constructor Details- 
SftpRemoteFileTemplatepublic SftpRemoteFileTemplate(SessionFactory<org.apache.sshd.sftp.client.SftpClient.DirEntry> sessionFactory) 
 
- 
- 
Method Details- 
executeWithClientDescription copied from interface:RemoteFileOperationsExecute 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:
- executeWithClientin interface- RemoteFileOperations<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Overrides:
- executeWithClientin class- RemoteFileTemplate<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Type Parameters:
- T- The type returned by- ClientCallback.doWithClient(Object).
- C- The type of the underlying client object.
- Parameters:
- callback- the ClientCallback.
- Returns:
- The result of the callback method.
 
- 
doExecuteWithClientprotected <T> T doExecuteWithClient(ClientCallback<org.apache.sshd.sftp.client.SftpClient, T> callback) 
- 
shouldMarkSessionAsDirtyDescription copied from class:RemoteFileTemplateDetermine whetherSession.dirty()should be called in theRemoteFileTemplate.execute(SessionCallback)when an exception is thrown from the callback. By default, this method returnstrue. Remote file protocol extensions can override this method to provide a specific strategy against the thrown exception, e.g.file not founderror is not a signal that session is broken.- Overrides:
- shouldMarkSessionAsDirtyin class- RemoteFileTemplate<org.apache.sshd.sftp.client.SftpClient.DirEntry>
- Parameters:
- ex- the exception to check if- Sessionmust be marked as dirty.
- Returns:
- true if Session.dirty()should be called.
 
- 
isStatusDirtyprotected boolean isStatusDirty(int status) Check ifSftpException.getStatus()is treated as fatal.- Parameters:
- status- the value from- SftpException.getStatus().
- Returns:
- true if SftpException.getStatus()is treated as fatal.
- Since:
- 6.0.8
 
 
-