On 6 June 2016 at 15:53, Clark Stuth <clarkst...@carfax.com> wrote: > We think we've identified a mis-documented feature with FTPClient in > commons-net, specifically the getStatus() methods. According to the FTP > protocol, STAT should return server status information. However, > according to the FTPClient documentation > (https://github.com/apache/commons-net/blob/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java#L3510), > the STAT command is used to retrieve remote file listings.
Actually STAT is used for both; see below. > As a result, > we are running into an issue with how Spring Framework Integration is > using the FtpClient.getStatus(path) command. > > From our own testing it does not appear that the FTP Server's stat() > command returns a different result when presented with a pathname or > not. The STAT command primarily seems to return server and connection > status information, not file information. I think you are confusing the server STAT command with the ftp client 'status' command. > The following two examples will show the FTP Server Output when > presented with the STAT command against no path, a file that exists, and > an invalid path (file does not exist). > OpenVMS Implementation: > https://raw.githubusercontent.com/clarkstuth/spring-ftp-template-spike/master/status_command_OpenVMS.txt > PureFTPD Implementation: > https://raw.githubusercontent.com/clarkstuth/spring-ftp-template-spike/master/status_command_PureFTPD.txt Those examples show the ftp client 'status' command. This is not the same thing as the FTP protocol STAT command. There is a difference between the commands that can be issued to an FTP client and the commands that an FTP server accepts. An FTP client translates the commands you provide into commands that FTP servers understand. The NET FTP code talks directly to the FTP server, so uses server commands. The FTP server commands are documented in RFC 959. If you search for STAT in https://www.ietf.org/rfc/rfc959.txt you should find it at the bottom of page 33. This explains how the server interprets a STAT command on its own and with a filename parameter. > Is it possible we are misinterpreting what this stat command should be > doing? Yes > It appears the FTP protocol functions differently than how this > method is documented. The Javadoc says that it issues the STAT command to the server, which is correct. However that is not the same as the "status" command that an FTP client may accept. > If the functionality of the STAT command is vendor dependent, would it > be possible to update the documentation to include this? Please note that this is off-topic for the developer list. So if you want further support on how to use the NET library, please subscribe to the Commons User mailing list and ask there. > Thanks, > Clark Stuth, Sean Lally > Carfax Software > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org