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

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

    • FtpSession

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

    • remove

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

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

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

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

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

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

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

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

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface 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(String pathFrom, String pathTo) throws IOException
      Specified by:
      rename in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      IOException
    • mkdir

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

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

      public boolean exists(String path) throws IOException
      Specified by:
      exists in interface org.springframework.integration.file.remote.session.Session<org.apache.commons.net.ftp.FTPFile>
      Throws:
      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 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>