throw new SendFileTransferException("not connected");
if (!(targetReceiver instanceof XMPPFileID))
throw new SendFileTransferException("target receiver not XMPPFileID type.");
final XMPPFileID fileID = (XMPPFileID) targetReceiver;
int requestTimeout = -1;
if (options != null) {
final Object option = options.get(OUTGOING_REQUEST_TIMEOUT);
if (option != null) {
if (option instanceof String) {
try {
requestTimeout = Integer.valueOf((String) option).intValue();
} catch (final NumberFormatException e) {
// Ignore
}
} else if (option instanceof Integer) {
requestTimeout = ((Integer) option).intValue();
}
}
}
final XMPPOutgoingFileTransfer fileTransfer = new XMPPOutgoingFileTransfer(manager, fileID.getXMPPID(), localFileToSend, progressListener, requestTimeout);
try {
fileTransfer.startSend(localFileToSend.getFile(), localFileToSend.getDescription());
} catch (final XMPPException e) {
throw new SendFileTransferException("Exception sending outgoing file transfer request", e);