File file = new File(download.filename());
file.renameTo(new File(finalDirectory, download.pack().name()));
eventBus.post(new DownloadFinished(download));
+ dccReceivers.remove(dccDownloadFinished.dccReceiver());
} catch (IOException ioe1) {
/* TODO - handle all the errors. */
logger.log(Level.WARNING, String.format("Could not move file %s to directory %s.", download.filename(), finalDirectory), ioe1);
try {
Closeables.close(download.outputStream(), true);
eventBus.post(new DownloadFailed(download));
+ dccReceivers.remove(dccDownloadFailed.dccReceiver());
} catch (IOException ioe1) {
/* swallow silently. */
}