Interface FtpClient

  • All Known Implementing Classes:
    FTPClientWrapper

    public interface FtpClient
    What VFS expects from an FTP client to provide.
    • Method Detail

      • abort

        boolean abort()
               throws java.io.IOException
        Throws:
        java.io.IOException
      • appendFileStream

        java.io.OutputStream appendFileStream​(java.lang.String relPath)
                                       throws java.io.IOException
        Throws:
        java.io.IOException
      • completePendingCommand

        boolean completePendingCommand()
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • deleteFile

        boolean deleteFile​(java.lang.String relPath)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • disconnect

        void disconnect()
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • getReplyCode

        default int getReplyCode()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getReplyString

        java.lang.String getReplyString()
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • hasFeature

        boolean hasFeature​(java.lang.String feature)
                    throws java.io.IOException
        Queries the server for a supported feature.
        Parameters:
        feature - the name of the feature, converted to upper case.
        Returns:
        true if the feature is present, false if the feature is not present or the FTP command failed.
        Throws:
        java.io.IOException - on error
        Since:
        2.8.0
      • listFiles

        org.apache.commons.net.ftp.FTPFile[] listFiles​(java.lang.String relPath)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • makeDirectory

        boolean makeDirectory​(java.lang.String relPath)
                       throws java.io.IOException
        Throws:
        java.io.IOException
      • mdtmInstant

        default java.time.Instant mdtmInstant​(java.lang.String relPath)
                                       throws java.io.IOException
        Sends the MDTM command to get a file's date and time information after file transfer. It is typically more accurate than the "LIST" command response. Time values are always represented in UTC (GMT), and in the Gregorian calendar regardless of what calendar may have been in use at the date and time the file was last modified.

        NOTE: not all remote FTP servers support MDTM.

        Parameters:
        relPath - The relative path of the file object to execute MDTM command against
        Returns:
        new Instant object containing the MDTM timestamp.
        Throws:
        java.io.IOException - If the underlying FTP client encountered an error.
        Since:
        2.8.0
      • removeDirectory

        boolean removeDirectory​(java.lang.String relPath)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • rename

        boolean rename​(java.lang.String oldName,
                       java.lang.String newName)
                throws java.io.IOException
        Throws:
        java.io.IOException
      • retrieveFileStream

        java.io.InputStream retrieveFileStream​(java.lang.String relPath)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • retrieveFileStream

        default java.io.InputStream retrieveFileStream​(java.lang.String relPath,
                                                       int bufferSize)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • retrieveFileStream

        java.io.InputStream retrieveFileStream​(java.lang.String relPath,
                                               long restartOffset)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • storeFileStream

        java.io.OutputStream storeFileStream​(java.lang.String relPath)
                                      throws java.io.IOException
        Throws:
        java.io.IOException