Task t = TaskManager.createTask("Download", num, "files");
for(FileDownload fd : queue) {
downloadURLNow(fd.url, fd.to, fd.sha1, fd.force);
t.advanceProgress();
}
t.complete();
queue.clear();
}
public static void downloadURLNow(URL url, File to, SHA1Sum sha1, boolean force) throws Exception {
// Make sure the path to the file exists