Examples of AWSBucket


Examples of com.sk89q.skmcl.minecraft.model.AWSBucket

            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;
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.