Class LapisUpdater


  • public class LapisUpdater
    extends java.lang.Object
    An utility class to check and download plugin updates using GitHub
    • Constructor Summary

      Constructors 
      Constructor Description
      LapisUpdater​(org.bukkit.plugin.java.JavaPlugin plugin, java.lang.String jarName, java.lang.String username, java.lang.String repoName, java.lang.String branch)
      The URL to the latest jar should be https://raw.githubusercontent.com/username/repoName/branch/updater/ID/jarName.jar
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean checkUpdate()
      Check if there is an update
      void downloadUpdate()
      Downloads the latest jar (if there is an update) and readies it for installation
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LapisUpdater

        public LapisUpdater​(org.bukkit.plugin.java.JavaPlugin plugin,
                            java.lang.String jarName,
                            java.lang.String username,
                            java.lang.String repoName,
                            java.lang.String branch)
        The URL to the latest jar should be https://raw.githubusercontent.com/username/repoName/branch/updater/ID/jarName.jar
        Parameters:
        plugin - The main class of your plugin
        jarName - The name of the jar file, excludes .jar
        username - The github username used for the repo
        repoName - The repo name
        branch - The branch name
    • Method Detail

      • checkUpdate

        public boolean checkUpdate()
        Check if there is an update
        Returns:
        True if there is an update
      • downloadUpdate

        public void downloadUpdate()
        Downloads the latest jar (if there is an update) and readies it for installation