if (e.getStatus() == FileTransfer.Status.COMPLETED) {
xmppSession.send(iq.createResult());
fileTransfer.removeFileTransferStatusListener(this);
} else if (e.getStatus() == FileTransfer.Status.CANCELED ||
e.getStatus() == FileTransfer.Status.FAILED) {
xmppSession.send(iq.createError(new StanzaError(new ItemNotFound())));
fileTransfer.removeFileTransferStatusListener(this);
}
}
});
return fileTransfer;