I have an ftplet from which I am calling my code to display the messages
in a JMS queue, when the user does a list command. I am getting the
message size and message id from the JMS system and displaying it at
the ftp command window by the following code:
public FtpletEnum onListStart(FtpSession session, FtpRequest request,
FtpReplyOutput response)
throws FtpException, IOException {
//for all the messages in the msgList, display the list info
for(int i=0;i<=msgList.size(); i++) {
try{
msg = (Message) msgList.get(i);
queue.get(msg, gmo);
response.write(new DefaultFtpReply(msg.size(),msg.id));
}catch(MQException ex) {
log(ex.toString);
}
}
Now, the problem is that on the user ftp command window, not all the
list elements are printed. I think at response.write() there is some
kind of buffering going on and the buffer is flushed only at the time of
exit from ftp. I would appreciate if anyone can point me where I am
making the mistake or a better way of doing it.
Thanks
Ajith