Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.5k views
in Java FTP by (120 points)
Hi. I'm trying to implement FTP and SSH connections in my application. The FTP connection was already implemented, so I planned to use the FTPClientFactory class to create either a FTPClient or a SSHFTPClient object, which both implements the FTPClientInterface interface.

The problem is that my application uses the FTPClient.getLastValidReply() method to get the server reply, but neither the SSHFTPClient class nor FTPClientInterface interface has a method to get something similar to a FTPReply object.

Does anybody know how to get the server reply in a SSH connection, if this is possible?


---------
Greets,
Vetinari

1 Answer

0 votes
by (162k points)
SSH works very differently to FTP and there's not really an equivalent last server reply, which is why it isn't in the interface.

You may have to use instanceof to check if it is of type FTPClient, and then look at getLastValidReply.

Categories

...