Created
June 26, 2020 18:06
-
-
Save TheFlash787/f404d82bb25f85e51277546d12b153dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void update(){ | |
updater.getUpdaterConfiguration().getFileURLs().forEach((plugin, url) -> { | |
url = url.replace("{name}", plugin); | |
try{ | |
File pluginFile = new File(updater.getConfigDir().getParent().getParent() + File.separator + "plugins" + File.separator + plugin + ".jar"); | |
FileUtils.copyURLToFile(new URL(url), pluginFile); | |
updater.getLogger().info("Successfully grabbed the latest build of " + plugin + "!"); | |
} catch (IOException e){ | |
updater.getLogger().warning("Error whilst trying to update " + plugin + " from the given URL (" + url + ")"); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment