Skip to content
This repository was archived by the owner on Aug 18, 2024. It is now read-only.

Commit dc4f4f7

Browse files
committed
delete unused methods
1 parent 18e6588 commit dc4f4f7

File tree

1 file changed

+3
-38
lines changed

1 file changed

+3
-38
lines changed

src/main/java/com/pistacium/modcheck/util/ModCheckUtils.java

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
package com.pistacium.modcheck.util;
22

3-
import com.google.gson.*;
4-
import com.pistacium.modcheck.ModCheck;
3+
import com.google.gson.FieldNamingPolicy;
4+
import com.google.gson.Gson;
5+
import com.google.gson.GsonBuilder;
56

67
import java.io.*;
78
import java.net.HttpURLConnection;
89
import java.net.URL;
910
import java.nio.charset.StandardCharsets;
1011
import java.util.HashMap;
11-
import java.util.Objects;
12-
import java.util.jar.JarEntry;
13-
import java.util.jar.JarFile;
1412

1513
public class ModCheckUtils {
1614
private static final HashMap<String, String> urlReqCache = new HashMap<>();
@@ -43,39 +41,6 @@ public static String getUrlRequest(String url) throws IllegalAccessException {
4341
throw new IllegalAccessException("Couldn't loading url request data! check your internet status");
4442
}
4543

46-
public static JsonObject getFabricJsonFileInJar(File jarFile) {
47-
try {
48-
JarFile file = new JarFile(jarFile);
49-
JarEntry entry = file.getJarEntry("fabric.mod.json");
50-
51-
int readBytes;
52-
if (entry != null) {
53-
InputStream is = file.getInputStream(entry);
54-
StringBuilder jsonString = new StringBuilder();
55-
56-
while ((readBytes = is.read()) != -1) {
57-
jsonString.append((char) readBytes);
58-
}
59-
60-
return JsonParser.parseString(jsonString.toString()).getAsJsonObject();
61-
}
62-
} catch (IOException e) {
63-
e.printStackTrace();
64-
}
65-
return null;
66-
}
67-
68-
public static String getAPIUrl(String url, String type) {
69-
if (Objects.equals(type, "github_releases")) {
70-
return "https://me.redlimerl.com/mcsr/modcheck?type=github&target=" + url.split("/")[4] + "%2F" + url.split("/")[5];
71-
}
72-
if (Objects.equals(type, "curseforge_files")) {
73-
return "https://me.redlimerl.com/mcsr/modcheck?type=curseforge&target=" + url.split("/")[5];
74-
}
75-
76-
return url;
77-
}
78-
7944
public static Config readConfig() {
8045
Gson gson = new Gson();
8146
File file = new File("modcheck.json");

0 commit comments

Comments
 (0)