Class SftpRemoteFileTemplate

java.lang.Object
org.springframework.integration.file.remote.RemoteFileTemplate<com.jcraft.jsch.ChannelSftp.LsEntry>
org.springframework.integration.sftp.session.SftpRemoteFileTemplate
All Implemented Interfaces:
Aware, BeanFactoryAware, InitializingBean, RemoteFileOperations<com.jcraft.jsch.ChannelSftp.LsEntry>

public class SftpRemoteFileTemplate extends RemoteFileTemplate<com.jcraft.jsch.ChannelSftp.LsEntry>
SFTP version of RemoteFileTemplate providing type-safe access to the underlying ChannelSftp object.
Since:
4.1
Author:
Gary Russell
  • Constructor Details

    • SftpRemoteFileTemplate

      public SftpRemoteFileTemplate(SessionFactory<com.jcraft.jsch.ChannelSftp.LsEntry> sessionFactory)
  • Method Details

    • executeWithClient

      public <T, C> T executeWithClient(ClientCallback<C,T> callback)
      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 interface RemoteFileOperations<com.jcraft.jsch.ChannelSftp.LsEntry>
      Overrides:
      executeWithClient in class RemoteFileTemplate<com.jcraft.jsch.ChannelSftp.LsEntry>
      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.
    • doExecuteWithClient

      protected <T> T doExecuteWithClient(ClientCallback<com.jcraft.jsch.ChannelSftp,T> callback)