Tried to fix an IOException

This commit is contained in:
Fangoboyo 2022-06-08 16:02:18 -07:00
parent 0369a72916
commit 214734c519
3 changed files with 8 additions and 4 deletions

View File

@ -31,11 +31,15 @@ public class Installer {
public static void InstallUpdater() throws IOException { public static void InstallUpdater() throws IOException {
File file = new File(Main.getInstance().getDataFolder().getParent() + "/EaglerPluginUpdater.jar"); File file = new File(Main.getInstance().getDataFolder().getParent() + "/EaglerPluginUpdater.jar");
System.out.println("Check 1 passed");
if (!(file.exists())) { if (!(file.exists())) {
URL plugin = URI.create("https://github.com/darverdevs/EaglerPluginUpdater/raw/main/out/artifacts/EaglerPluginUpdater_jar/EaglerPluginUpdater.jar") System.out.println("Check 2 passed");
.toURL(); try {
InputStream in = plugin.openStream(); InputStream in = URI.create("https://github.com/darverdevs/EaglerPluginUpdater/raw/main/out/artifacts/EaglerPluginUpdater_jar/EaglerPluginUpdater.jar")
Files.copy(in, file.toPath(), StandardCopyOption.REPLACE_EXISTING); .toURL().openStream();
System.out.println("Check 3 passed");
Files.copy(in, file.toPath(), StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {}
} }
} }
} }