Package dev.cwhead.GravesX.util
Class PluginDownloadUtil
java.lang.Object
dev.cwhead.GravesX.util.PluginDownloadUtil
Utility methods to download plugin jars from Spiget and place them in the server's plugins folder.
Note: This class uses simple HTTP requests with sensible timeouts and follows redirects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
downloadAndReplacePlugin
(long pluginId, String pluginName, String pluginsFolder, org.bukkit.command.CommandSender commandSender) Downloads a plugin from Spiget and saves it to the plugins folder, replacing it if it exists.static void
downloadAndReplacePlugin
(String pluginId, String pluginName, String pluginsFolder, org.bukkit.command.CommandSender commandSender) Downloads a plugin from Spiget and saves it to the plugins folder, replacing it if it exists.
-
Method Details
-
downloadAndReplacePlugin
public static void downloadAndReplacePlugin(long pluginId, String pluginName, String pluginsFolder, org.bukkit.command.CommandSender commandSender) throws IOException Downloads a plugin from Spiget and saves it to the plugins folder, replacing it if it exists.- Parameters:
pluginId
- The Spigot resource ID of the plugin.pluginName
- The name of the plugin file (without the ".jar" extension).pluginsFolder
- The path to the plugins' folder.- Throws:
IOException
- If the download or file operations fail.
-
downloadAndReplacePlugin
public static void downloadAndReplacePlugin(String pluginId, String pluginName, String pluginsFolder, org.bukkit.command.CommandSender commandSender) throws IOException Downloads a plugin from Spiget and saves it to the plugins folder, replacing it if it exists.- Parameters:
pluginId
- The Spigot resource ID of the plugin.pluginName
- The name of the plugin file (without the ".jar" extension).pluginsFolder
- The path to the plugins' folder.- Throws:
IOException
- If the download or file operations fail.
-