try {
URL url = new URL(attachmentUrl);
// Send the file
is = url.openStream();
OutgoingFileTransfer.setResponseTimeout(10000);
transfer.sendStream(is, url.getFile(), is.available(), message);
logger.debug("Sent message '{}' with attachment '{}' to '{}'.", new String[] { message, attachmentUrl, to });
success = true;
} catch (IOException e) {
logger.error("Could not open url '{}' for sending it via XMPP", attachmentUrl, e);
} finally {