Class FTPClientWrapper

  • All Implemented Interfaces:
    FtpClient

    public class FTPClientWrapper
    extends java.lang.Object
    implements FtpClient
    A wrapper to the FTPClient to allow automatic reconnect on connection loss.

    I decided to not to use eg. noop() to determine the state of the connection to avoid unnecessary server round-trips.

    • Method Detail

      • disconnect

        public void disconnect()
                        throws java.io.IOException
        Specified by:
        disconnect in interface FtpClient
        Throws:
        java.io.IOException
      • listFiles

        public org.apache.commons.net.ftp.FTPFile[] listFiles​(java.lang.String relPath)
                                                       throws java.io.IOException
        Specified by:
        listFiles in interface FtpClient
        Throws:
        java.io.IOException
      • removeDirectory

        public boolean removeDirectory​(java.lang.String relPath)
                                throws java.io.IOException
        Specified by:
        removeDirectory in interface FtpClient
        Throws:
        java.io.IOException
      • deleteFile

        public boolean deleteFile​(java.lang.String relPath)
                           throws java.io.IOException
        Specified by:
        deleteFile in interface FtpClient
        Throws:
        java.io.IOException
      • rename

        public boolean rename​(java.lang.String oldName,
                              java.lang.String newName)
                       throws java.io.IOException
        Specified by:
        rename in interface FtpClient
        Throws:
        java.io.IOException
      • makeDirectory

        public boolean makeDirectory​(java.lang.String relPath)
                              throws java.io.IOException
        Specified by:
        makeDirectory in interface FtpClient
        Throws:
        java.io.IOException
      • completePendingCommand

        public boolean completePendingCommand()
                                       throws java.io.IOException
        Specified by:
        completePendingCommand in interface FtpClient
        Throws:
        java.io.IOException
      • retrieveFileStream

        public java.io.InputStream retrieveFileStream​(java.lang.String relPath)
                                               throws java.io.IOException
        Specified by:
        retrieveFileStream in interface FtpClient
        Throws:
        java.io.IOException
      • retrieveFileStream

        public java.io.InputStream retrieveFileStream​(java.lang.String relPath,
                                                      long restartOffset)
                                               throws java.io.IOException
        Specified by:
        retrieveFileStream in interface FtpClient
        Throws:
        java.io.IOException
      • appendFileStream

        public java.io.OutputStream appendFileStream​(java.lang.String relPath)
                                              throws java.io.IOException
        Specified by:
        appendFileStream in interface FtpClient
        Throws:
        java.io.IOException
      • storeFileStream

        public java.io.OutputStream storeFileStream​(java.lang.String relPath)
                                             throws java.io.IOException
        Specified by:
        storeFileStream in interface FtpClient
        Throws:
        java.io.IOException
      • abort

        public boolean abort()
                      throws java.io.IOException
        Specified by:
        abort in interface FtpClient
        Throws:
        java.io.IOException
      • getReplyString

        public java.lang.String getReplyString()
                                        throws java.io.IOException
        Specified by:
        getReplyString in interface FtpClient
        Throws:
        java.io.IOException