java.lang.Object
org.springframework.integration.ftp.session.FtpSession
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>

public class FtpSession
extends java.lang.Object
implements org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
Implementation of Session for FTP.
Since:
2.0
  • Constructor Summary

    Constructors 
    Constructor Description
    FtpSession​(org.apache.commons.net.ftp.FTPClient client)  
  • Method Summary

    Modifier and Type Method Description
    void append​(java.io.InputStream inputStream, java.lang.String path)  
    void close()  
    boolean exists​(java.lang.String path)  
    boolean finalizeRaw()  
    org.apache.commons.net.ftp.FTPClient getClientInstance()  
    java.lang.String getHostPort()  
    boolean isOpen()  
    org.apache.commons.net.ftp.FTPFile[] list​(java.lang.String path)  
    java.lang.String[] listNames​(java.lang.String path)  
    boolean mkdir​(java.lang.String remoteDirectory)  
    void read​(java.lang.String path, java.io.OutputStream fos)  
    java.io.InputStream readRaw​(java.lang.String source)  
    boolean remove​(java.lang.String path)  
    void rename​(java.lang.String pathFrom, java.lang.String pathTo)  
    boolean rmdir​(java.lang.String directory)  
    boolean test()  
    void write​(java.io.InputStream inputStream, java.lang.String path)  

    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

    dirty
  • Constructor Details

    • FtpSession

      public FtpSession​(org.apache.commons.net.ftp.FTPClient client)
  • Method Details

    • remove

      public boolean remove​(java.lang.String path) throws java.io.IOException
      Specified by:
      remove in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • list

      public org.apache.commons.net.ftp.FTPFile[] list​(java.lang.String path) throws java.io.IOException
      Specified by:
      list in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • listNames

      public java.lang.String[] listNames​(java.lang.String path) throws java.io.IOException
      Specified by:
      listNames in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • read

      public void read​(java.lang.String path, java.io.OutputStream fos) throws java.io.IOException
      Specified by:
      read in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • readRaw

      public java.io.InputStream readRaw​(java.lang.String source) throws java.io.IOException
      Specified by:
      readRaw in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • finalizeRaw

      public boolean finalizeRaw() throws java.io.IOException
      Specified by:
      finalizeRaw in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • write

      public void write​(java.io.InputStream inputStream, java.lang.String path) throws java.io.IOException
      Specified by:
      write in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • append

      public void append​(java.io.InputStream inputStream, java.lang.String path) throws java.io.IOException
      Specified by:
      append in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • 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 org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
    • rename

      public void rename​(java.lang.String pathFrom, java.lang.String pathTo) throws java.io.IOException
      Specified by:
      rename in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • mkdir

      public boolean mkdir​(java.lang.String remoteDirectory) throws java.io.IOException
      Specified by:
      mkdir in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • rmdir

      public boolean rmdir​(java.lang.String directory) throws java.io.IOException
      Specified by:
      rmdir in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • exists

      public boolean exists​(java.lang.String path) throws java.io.IOException
      Specified by:
      exists in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      java.io.IOException
    • getClientInstance

      public org.apache.commons.net.ftp.FTPClient getClientInstance()
      Specified by:
      getClientInstance in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
    • getHostPort

      public java.lang.String getHostPort()
      Specified by:
      getHostPort in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
    • test

      public boolean test()
      Specified by:
      test in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>