Examples of AssetsIndex


Examples of com.skcraft.launcher.model.minecraft.AssetsIndex

     * @throws LauncherException
     */
    public AssetsTreeBuilder createAssetsBuilder(@NonNull VersionManifest versionManifest) throws LauncherException {
        String indexId = versionManifest.getAssetsIndex();
        File path = getIndexPath(versionManifest);
        AssetsIndex index = Persistence.read(path, AssetsIndex.class, true);
        if (index == null || index.getObjects() == null) {
            throw new LauncherException("Missing index at " + path, _("assets.missingIndex", path.getAbsolutePath()));
        }
        File treeDir = new File(dir, "virtual/" + indexId);
        treeDir.mkdirs();
        return new AssetsTreeBuilder(index, treeDir);
View Full Code Here

Examples of com.skcraft.launcher.model.minecraft.AssetsIndex

                                 @NonNull VersionManifest versionManifest,
                                 @NonNull URL indexUrl,
                                 @NonNull List<URL> sources) throws IOException, InterruptedException {
        AssetsRoot assetsRoot = launcher.getAssets();

        AssetsIndex index = HttpRequest
                .get(indexUrl)
                .execute()
                .expectResponseCode(200)
                .returnContent()
                .saveContent(assetsRoot.getIndexPath(versionManifest))
                .asJson(AssetsIndex.class);

        // Keep track of duplicates
        Set<String> downloading = new HashSet<String>();

        for (Map.Entry<String, Asset> entry : index.getObjects().entrySet()) {
            checkInterrupted();

            String hash = entry.getValue().getHash();
            String path = String.format("%s/%s", hash.subSequence(0, 2), hash);
            File targetFile = assetsRoot.getObjectPath(entry.getValue());
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.