Obtain a list of filenames in a directory (or just the name of a given file, which is not particularly useful). This information is obtained through the NLST command. If the given pathname is a directory and contains no files, a zero length array is returned only if the FTP server returned a positive completion code, otherwise null is returned (the FTP server returned a 550 error No files found.). If the directory is not empty, an array of filenames in the directory is returned. If the pathname corresponds to a file, only that file will be listed. The server may or may not expand glob expressions.
@param pathname The file or directory to list.
@return The list of filenames contained in the given path. null ifthe list could not be obtained. If there are no filenames in the directory, a zero-length array is returned.
@exception FTPConnectionClosedException If the FTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send FTP reply code 421. This exception may be caught either as an IOException or independently as itself.
@exception IOException If an I/O error occurs while either sending acommand to the server or receiving a reply from the server.