fileDialog.setText("Choose file to send to " + user);
String file = fileDialog.open();
if(file == null) return false;
FileTransferManager manager = new FileTransferManager(account.xmpp.getConnection());
final OutgoingFileTransfer outgoingFileTransfer = manager.createOutgoingFileTransfer(user);
final File f = new File(file);
InputDialog descriptionInput = new InputDialog(parent,
"Sending file to " + user,
"Please Provide a description of the file (" + f.getName() + ") " +
"you want to send to " + user,
"",null);
if(descriptionInput.open() != InputDialog.OK) return false;
try {
outgoingFileTransfer.sendFile(f,descriptionInput.getValue());
final String task = "Sending file " + f.getName() + " to " + user;
showProgressMonitor(parent, outgoingFileTransfer, task);
} catch (Exception e) {
throw new RuntimeException("Error while trying to send file.",e);