This commit is contained in:
Telesphoreo 2023-03-08 19:29:30 -06:00
parent ea512487ac
commit 37649f1fdc
No known key found for this signature in database
GPG Key ID: B5CDDEBA526C0130
1 changed files with 16 additions and 12 deletions

View File

@ -5,6 +5,16 @@ import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonSyntaxException;
import dev.plex.PlexBase;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.Nonnull;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.apache.commons.io.FileUtils;
@ -15,19 +25,9 @@ import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.json.JSONException;
import org.json.JSONObject;
import javax.annotation.Nonnull;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicReference;
public class UpdateChecker implements PlexBase
{
/*
@ -48,7 +48,7 @@ public class UpdateChecker implements PlexBase
{
try
{
HttpURLConnection connection = (HttpURLConnection) new URL("https://api.github.com/repos/" + repo + "/compare/" + branch + "..." + hash).openConnection();
HttpURLConnection connection = (HttpURLConnection)new URL("https://api.github.com/repos/" + repo + "/compare/" + branch + "..." + hash).openConnection();
connection.connect();
if (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND)
{
@ -197,5 +197,9 @@ public class UpdateChecker implements PlexBase
{
e.printStackTrace();
}
catch (JSONException e)
{
sender.sendMessage(PlexUtils.mmDeserialize("<red>The file could not be downloaded because Jenkins returned an invalid response. (Is it on Jenkins?)"));
}
}
}