if (!downloads.isEmpty())
downloadManager.waitForCompletion(downloads);
}
private Download download(Fragment<File> fragment) {
File downloadable = fragment.getDownloadable();
List<FileAndChecksum> fragments = new ArrayList<>();
for (Fragment otherFragments : downloadable.getFragments())
fragments.add(new FileAndChecksum(createFile(otherFragments.getKey()), otherFragments.getLatestChecksum()));
String uri = downloadable.getUri();
String url = getBaseUrl() + uri;
return downloadManager.queueForDownload(getName() + ": Elevation Data " + uri, url, Flatten,
null, new FileAndChecksum(getDirectory(), downloadable.getLatestChecksum()), fragments);
}