Dears
I have found that the solution about below question on
https://www.mail-archive.com/[email protected]/msg22612.html
the afterCommand method has the reply parameter,I can use
【reply.isPositive()】 to judge whether the download is successful or not
public FtpletResult afterCommand(FtpSession session, FtpRequest request,
FtpReply reply)
throws FtpException, IOException {
and then I have one more question below:
1. although I can judge the result on onDownloadEnd,but when I use below
statement to ouput response to client,it will not be displayed on client
session.write(new DefaultFtpReply(FtpReply.REPLY_226_CLOSING_DATA_CONNECTION,
“customize message:Accept-No:XXX”));
“XXX” is dynamic value according to other
method’s return value
How could I output the customized message to client when the
download task completed?
I found that after the below statement, the customized response
message will not be output to client
dataConnection.transferToClient(session.getFtpletSession(), is);
Looking forward to your reply.
Best Regards
Fang Xun
From: FangXun(方勋)
Sent: Friday, September 24, 2021 5:13 PM
To: [email protected]
Subject: [ftplet] how to judage the download is successful or not in
[onDownloadEnd] method
Dears
This is fang xun from Panasonic Information System(ShangHai) Co.Ltd.
I am customizing apache ftp server with ftplet api, I wrote some
code in [onDownloadEnd] method,
I have some questions below,Could anyone has the answer will be appreciated
1. How to judge whether the download is successful or not in [onDownloadEnd]
method (* I found that even if download failed,the [onDownloadEnd] method will
be executed),because I will do different tasks according with the download
result(successful or not)
Looking forward to your reply.
Best Regards
Fang Xun