Class CachingSessionFactory.CachedSession

java.lang.Object
org.springframework.integration.file.remote.session.CachingSessionFactory.CachedSession
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, Session<F>
Enclosing class:
CachingSessionFactory<F>

public class CachingSessionFactory.CachedSession
extends java.lang.Object
implements Session<F>
  • Method Summary

    Modifier and Type Method Description
    void append​(java.io.InputStream inputStream, java.lang.String destination)
    Append to a file.
    void close()  
    void dirty()
    Mark this session as dirty, indicating that it should not be reused and any delegated sessions should be taken care of before closing.
    boolean exists​(java.lang.String path)
    Check if the remote file or directory exists.
    boolean finalizeRaw()
    Invoke after closing the InputStream from Session.readRaw(String).
    java.lang.Object getClientInstance()
    Get the underlying client library's client instance for this session.
    java.lang.String getHostPort()
    Return the host:port pair this session is connected to.
    boolean isOpen()  
    F[] list​(java.lang.String path)  
    java.lang.String[] listNames​(java.lang.String path)  
    boolean mkdir​(java.lang.String directory)  
    void read​(java.lang.String source, java.io.OutputStream os)  
    java.io.InputStream readRaw​(java.lang.String source)
    Retrieve a remote file as a raw InputStream.
    boolean remove​(java.lang.String path)  
    void rename​(java.lang.String pathFrom, java.lang.String pathTo)  
    boolean rmdir​(java.lang.String directory)
    Remove a remote directory.
    void write​(java.io.InputStream inputStream, java.lang.String destination)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.integration.file.remote.session.Session

    test
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface java.io.Closeable
      Specified by:
      close in interface Session<F>
    • remove

      public boolean remove​(java.lang.String path) throws java.io.IOException
      Specified by:
      remove in interface Session<F>
      Throws:
      java.io.IOException
    • list

      public F[] list​(java.lang.String path) throws java.io.IOException
      Specified by:
      list in interface Session<F>
      Throws:
      java.io.IOException
    • read

      public void read​(java.lang.String source, java.io.OutputStream os) throws java.io.IOException
      Specified by:
      read in interface Session<F>
      Throws:
      java.io.IOException
    • write

      public void write​(java.io.InputStream inputStream, java.lang.String destination) throws java.io.IOException
      Specified by:
      write in interface Session<F>
      Throws:
      java.io.IOException
    • append

      public void append​(java.io.InputStream inputStream, java.lang.String destination) throws java.io.IOException
      Description copied from interface: Session
      Append to a file.
      Specified by:
      append in interface Session<F>
      Parameters:
      inputStream - the stream.
      destination - the destination.
      Throws:
      java.io.IOException - an IO Exception.
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface Session<F>
    • rename

      public void rename​(java.lang.String pathFrom, java.lang.String pathTo) throws java.io.IOException
      Specified by:
      rename in interface Session<F>
      Throws:
      java.io.IOException
    • mkdir

      public boolean mkdir​(java.lang.String directory) throws java.io.IOException
      Specified by:
      mkdir in interface Session<F>
      Throws:
      java.io.IOException
    • rmdir

      public boolean rmdir​(java.lang.String directory) throws java.io.IOException
      Description copied from interface: Session
      Remove a remote directory.
      Specified by:
      rmdir in interface Session<F>
      Parameters:
      directory - The directory.
      Returns:
      True if the directory was removed.
      Throws:
      java.io.IOException - an IO exception.
    • exists

      public boolean exists​(java.lang.String path) throws java.io.IOException
      Description copied from interface: Session
      Check if the remote file or directory exists.
      Specified by:
      exists in interface Session<F>
      Parameters:
      path - the remote path.
      Returns:
      true or false if remote path exists or not.
      Throws:
      java.io.IOException - an IO exception during remote interaction.
    • listNames

      public java.lang.String[] listNames​(java.lang.String path) throws java.io.IOException
      Specified by:
      listNames in interface Session<F>
      Throws:
      java.io.IOException
    • readRaw

      public java.io.InputStream readRaw​(java.lang.String source) throws java.io.IOException
      Description copied from interface: Session
      Retrieve a remote file as a raw InputStream.
      Specified by:
      readRaw in interface Session<F>
      Parameters:
      source - The path of the remote file.
      Returns:
      The raw inputStream.
      Throws:
      java.io.IOException - Any IOException.
    • finalizeRaw

      public boolean finalizeRaw() throws java.io.IOException
      Description copied from interface: Session
      Invoke after closing the InputStream from Session.readRaw(String). Required by some session providers.
      Specified by:
      finalizeRaw in interface Session<F>
      Returns:
      true if successful.
      Throws:
      java.io.IOException - Any IOException.
    • dirty

      public void dirty()
      Description copied from interface: Session
      Mark this session as dirty, indicating that it should not be reused and any delegated sessions should be taken care of before closing.
      Specified by:
      dirty in interface Session<F>
      See Also:
      close()
    • getClientInstance

      public java.lang.Object getClientInstance()
      Description copied from interface: Session
      Get the underlying client library's client instance for this session. Returns an Object to avoid significant changes to -file, -ftp, -sftp modules, which would be required if we added another generic parameter. Implementations should narrow the return type.
      Specified by:
      getClientInstance in interface Session<F>
      Returns:
      The client instance.
    • getHostPort

      public java.lang.String getHostPort()
      Description copied from interface: Session
      Return the host:port pair this session is connected to.
      Specified by:
      getHostPort in interface Session<F>
      Returns:
      the host:port pair this session is connected to.