workUnit.push(0, _("minecraftUpdate.checkingAssets", bucketUrl.toString()));
logger.log(Level.INFO, "Enumerating assets from {0}...", bucketUrl);
checkInterrupted();
// Obtain the assets manifest
AWSBucket bucket = HttpRequest
.get(bucketUrl)
.execute()
.returnContent()
.asXml(AWSBucket.class);
// Install all the missing assets
for (AWSBucket.Item item : bucket.getContents()) {
String key = item.getKey();
String hash = item.getEtag();
if (item.isDirectory()) {
continue; // skip directories
}
URL url = item.getUrl(getAssetsUrl());
File file = new File(assetsDir, key);
if (!file.exists() || !getFileETag(file).equals(hash)) {
logger.log(Level.INFO, "Need to get {0}", key);
String id = hash + file.toString();
installer.copyTo(new HttpResource(url).withId(id), file);
}
marker = item.getKey();
}
// If the last bucket list is not truncated, then we're done
if (!bucket.isTruncated()) {
marker = null;
}
}
}