[
https://issues.apache.org/jira/browse/NET-397?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014051#comment-13014051
]
Sebb commented on NET-397:
--------------------------
Thanks again!
Cannot remove FTPSCommand without breaking binary compat. and I don't want to
do that.
I've just realised that overriding sendCommand(int) and sendCommand(int,
String) cannot be made to work properly, as it cannot distinguish between int
values from FTPCommand and int values from FTPSCommand. For the values that
overlap, there's no way to know what the caller intended. I suppose the method
could reject all duplicate values, but that might break existing code (which
uses the FTPCommand strings). [Had enums been used, this would not have been an
issue]
Good suggestion re sendFTPSCommand(); that would solve the problem of
differentiating the different int ranges.
However I think it might make the API more confusing, so I think deprecation is
better. If FTPSClient provides exec() methods for all the FTPS commands there
is then no need to use the integers (and anyway, FTPSCommand.getCommand() can
be used to convert the int to String)
I've no idea about PBSZ either, beyond extracting the minimum value for use by
client code. Could start with that.
> FTPSClient does not handle AUTH or ADAT and only partially handles PBSZ.
> FTPSCommand should be deprecated
> ----------------------------------------------------------------------------------------------------------
>
> Key: NET-397
> URL: https://issues.apache.org/jira/browse/NET-397
> Project: Commons Net
> Issue Type: Bug
> Reporter: Sebb
> Attachments: ftps-rfc2228.diff
>
>
> FTPSClient does not provide any code to handle AUTH or ADAT, and does not
> provide support for handling a reduced buffer size provided by the server.
> FTPSCommand defines int values for AUTH and ADAT, but if the integer values
> are used by client code, the value will be passed to FTPClient, which uses
> its own array of command strings, and FTPSCommand.AUTH will translate to
> "USER" and ADAT => "PASS", similarly for PBSZ, PROT and CCC.
> These commands all need special handling, so should be dealt with by
> FTPSClient only.
> FTPSClient can override the sendCommand(int) and sendCommand(int, String)
> methods in FTPClient which will help prevent problems.
> Since most of these commands need additional special handling, there should
> be execNAME() methods for each.
> FTPSCommand should be deprecated.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira