Rename PACK -> PACK_GZ

This commit is contained in:
yushijinhun
2018-08-04 23:11:31 +08:00
parent 86030e64ca
commit 3c2f232acb
2 changed files with 3 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ final class LocalRepository {
writeToStorage(downloaded, false); writeToStorage(downloaded, false);
break; break;
case PACK: case PACK_GZ:
Path unpacked = Files.createTempFile("hmcl-update-unpack-", null); Path unpacked = Files.createTempFile("hmcl-update-unpack-", null);
try { try {
try (InputStream in = new GZIPInputStream(Files.newInputStream(downloaded)); try (InputStream in = new GZIPInputStream(Files.newInputStream(downloaded));

View File

@@ -39,7 +39,7 @@ public class RemoteVersion {
String packUrl = Optional.ofNullable(response.get("pack")).map(JsonElement::getAsString).orElse(null); String packUrl = Optional.ofNullable(response.get("pack")).map(JsonElement::getAsString).orElse(null);
String packHash = Optional.ofNullable(response.get("packsha1")).map(JsonElement::getAsString).orElse(null); String packHash = Optional.ofNullable(response.get("packsha1")).map(JsonElement::getAsString).orElse(null);
if (packUrl != null && packHash != null) { if (packUrl != null && packHash != null) {
return new RemoteVersion(version, packUrl, Type.PACK, new IntegrityCheck("SHA-1", packHash)); return new RemoteVersion(version, packUrl, Type.PACK_GZ, new IntegrityCheck("SHA-1", packHash));
} else if (jarUrl != null && jarHash != null) { } else if (jarUrl != null && jarHash != null) {
return new RemoteVersion(version, jarUrl, Type.JAR, new IntegrityCheck("SHA-1", jarHash)); return new RemoteVersion(version, jarUrl, Type.JAR, new IntegrityCheck("SHA-1", jarHash));
} else { } else {
@@ -84,7 +84,7 @@ public class RemoteVersion {
} }
public enum Type { public enum Type {
PACK, PACK_GZ,
JAR JAR
} }
} }