Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
6.3k views
in Java FTP by
I think it would be beneficial if there was a public method in FTPClient called:

public boolean getCancelTransfer();

This way after a transfer completes, it could be programmatically checked from the FTP object whether a cancel was requested.

2 Answers

0 votes
by
Alternatively, it would be nice if calling cancel and the transfer actually cancels (eg connection is not idle or race condition allowed put()/get() to finish before calling cancel) would throw an FTPTransferCancelledException to be caught, that way one could know that there is an incomplete transfer somewhere.
0 votes
by (162k points)
Using an exception to indicate a transfer is incomplete is a good idea. To avoid breaking the current interface, we could make FTPTransferCancelledException a subclass of FTPException so that it could be caught explicitly if required.

Alternatively, it would be nice if calling cancel and the transfer actually cancels (eg connection is not idle or race condition allowed put()/get() to finish before calling cancel) would throw an FTPTransferCancelledException to be caught, that way one could know that there is an incomplete transfer somewhere.

Categories

...