Update Updater.java

This commit is contained in:
Fangoboyo 2022-06-07 22:16:06 -07:00
parent 3d0e6a8f91
commit f33832c16e

View File

@ -1,5 +1,19 @@
package tech.nully.PluginUpdater;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
public class Updater {
public void UpdateInstaller
public void UpdateInstaller() throws IOException {
InputStream in = URI.create("https://github.com/darverdevs/PluginInstaller/raw/main/out/artifacts/PluginInstaller_jar/PluginInstaller.jar")
.toURL().openStream();
File f = new File(Main.getInstance().getDataFolder().getParent() + "/" + "PluginInstaller" + ".jar");
f.delete();
Files.copy(in, f.toPath(), StandardCopyOption.REPLACE_EXISTING);
}
}