In my ftplet, I am trying to output a list of strings to the ftp client
session. I am using the response.write() to do this. But looks like
there is a lack of flushing in the response object stream, I get
different output each time.
For eg, for the commands mkdir, I get the following ouput:
ftp>mkdir testDir
1111 Test1111
ftp>mkdir testDir
2222 Test2222
3333 Test3333
4444 Test4444
ftp>mkdir testDir
1111 Test1111
My ftplet code is below:
public FtpletEnum onMkdirStart(FtpSession session, FtpRequest request,
FtpReplyOutput response)
throws FtpException, IOException {
try{
response.write(new DefaultFtpReply(1111,"Test1111" ));
response.write(new DefaultFtpReply(2222,"Test2222" ));
response.write(new DefaultFtpReply(3333,"Test3333" ));
response.write(new DefaultFtpReply(4444,"Test4444" ));
}catch(Exception ex){
System.out.println(ex.toString());
}
return FtpletEnum.RET_SKIP;
}
Is this a bug, or am I not using the proper method to do it. I
appreciate any help
Thanks
Ajith