Revert "Fix #632"

This reverts commit 30f86571
This commit is contained in:
huanghongxun
2019-12-14 09:20:01 +08:00
parent 30f8657174
commit 6e79d287f3

View File

@@ -29,10 +29,10 @@ import org.jackhuang.hmcl.util.Logging;
import org.jackhuang.hmcl.util.StringUtils; import org.jackhuang.hmcl.util.StringUtils;
import org.jackhuang.hmcl.util.gson.JsonUtils; import org.jackhuang.hmcl.util.gson.JsonUtils;
import org.jackhuang.hmcl.util.io.FileUtils; import org.jackhuang.hmcl.util.io.FileUtils;
import org.jackhuang.hmcl.util.io.NetworkUtils;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.URL;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.*; import java.util.*;
@@ -72,9 +72,9 @@ public class ServerModpackCompletionTask extends Task<Void> {
} }
@Override @Override
public void preExecute() { public void preExecute() throws Exception {
if (manifest == null || StringUtils.isBlank(manifest.getManifest().getFileApi())) return; if (manifest == null || StringUtils.isBlank(manifest.getManifest().getFileApi())) return;
dependent = new GetTask(NetworkUtils.toURL(manifest.getManifest().getFileApi() + "/server-manifest.json")); dependent = new GetTask(new URL(manifest.getManifest().getFileApi() + "/server-manifest.json"));
} }
@Override @Override
@@ -125,7 +125,7 @@ public class ServerModpackCompletionTask extends Task<Void> {
if (download) { if (download) {
dependencies.add(new FileDownloadTask( dependencies.add(new FileDownloadTask(
NetworkUtils.toURL(remoteManifest.getFileApi() + "/overrides/" + file.getPath()), new URL(remoteManifest.getFileApi() + "/overrides/" + file.getPath()),
actualPath.toFile(), actualPath.toFile(),
new FileDownloadTask.IntegrityCheck("SHA-1", file.getHash()))); new FileDownloadTask.IntegrityCheck("SHA-1", file.getHash())));
} }