}
/* remove download. */
- downloads.remove(download);
+ downloads.remove(download.pack().name());
return;
}
eventBus.post(new GenericError(String.format("Download %s from %s does not start at the right position!")));
logger.log(Level.WARNING, String.format("Download %s from %s: have %d bytes but wants to resume from %d!", dccAcceptReceived.filename(), dccAcceptReceived.source(), outputFile.length(), dccAcceptReceived.position()));
- downloads.remove(download);
+ downloads.remove(download.pack().name());
return;
}
OutputStream outputStream = new FileOutputStream(outputFile, true);
file.renameTo(new File(finalDirectory, download.pack().name()));
eventBus.post(new DownloadFinished(download));
dccReceivers.remove(dccDownloadFinished.dccReceiver());
- downloads.remove(download);
+ downloads.remove(download.pack().name());
} 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);
Closeables.close(download.outputStream(), true);
eventBus.post(new DownloadFailed(download));
dccReceivers.remove(dccDownloadFailed.dccReceiver());
- downloads.remove(download);
+ downloads.remove(download.pack().name());
} catch (IOException ioe1) {
/* swallow silently. */
}