Class DefaultFTPFileListParser

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FTPFile[] parseFileList​(java.io.InputStream listStream)
      Parses an FTP server file listing and converts it into a usable format in the form of an array of FTPFile instances.
      FTPFile parseFTPEntry​(java.lang.String entry)
      Parses an FTP server listing entry (a single line) and returns an FTPFile instance with the resulting information.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultFTPFileListParser

        public DefaultFTPFileListParser()
    • Method Detail

      • parseFTPEntry

        public FTPFile parseFTPEntry​(java.lang.String entry)
        Parses an FTP server listing entry (a single line) and returns an FTPFile instance with the resulting information. If the entry could not be parsed, returns null.

        Parameters:
        entry - A single line of an FTP server listing with the end of line truncated.
        Returns:
        An FTPFile instance representing the file information. null if the entry could be parsed, returns null.
      • parseFileList

        public FTPFile[] parseFileList​(java.io.InputStream listStream)
                                throws java.io.IOException
        Parses an FTP server file listing and converts it into a usable format in the form of an array of FTPFile instances. If the file list contains no files, null is returned, otherwise an array of FTPFile instances representing the files in the directory is returned.

        Specified by:
        parseFileList in interface FTPFileListParser
        Parameters:
        listStream - The InputStream from which the file list should be read.
        Returns:
        The list of file information contained in the given path. null if the list could not be obtained or if there are no files in the directory.
        Throws:
        java.io.IOException - If an I/O error occurs reading the listStream.