Package one.tranic.t.base.updater
Class SpigotVersionFetcher
java.lang.Object
one.tranic.t.base.updater.VersionFetcher
one.tranic.t.base.updater.SpigotVersionFetcher
- All Implemented Interfaces:
AutoCloseable,Runnable
The FetchVersion class is responsible for managing the fetching and updating of a plugin's version.
It performs periodic version checks, determines whether an update is available, and provides formatted messages displaying update statuses.
This class implements both the AutoCloseable and Runnable interfaces for resource management and
asynchronous operations, respectively.
-
Constructor Summary
ConstructorsConstructorDescriptionSpigotVersionFetcher(String currentVersion, String pluginName, String resourceId) Constructs aFetchVersioninstance for version checking and updating purposes.SpigotVersionFetcher(String currentVersion, String pluginName, String resourceId, String resourceURL) Constructs a new FetchVersion instance responsible for managing version fetching and updates. -
Method Summary
Methods inherited from class one.tranic.t.base.updater.VersionFetcher
close, fetchLatestVersion, getLatestVersion, getNoUpdateMessage, getResourceURL, getUpdateMessage, hasUpdate, isExpired, run, start, updateResourceURL
-
Constructor Details
-
SpigotVersionFetcher
Constructs aFetchVersioninstance for version checking and updating purposes.- Parameters:
currentVersion- the current version of the associated plugin or application.pluginName- the name of the plugin or application being checked for updates.resourceId- the unique identifier for the resource being checked, typically corresponding to its ID on the update server.
-
SpigotVersionFetcher
public SpigotVersionFetcher(String currentVersion, String pluginName, String resourceId, String resourceURL) Constructs a new FetchVersion instance responsible for managing version fetching and updates.- Parameters:
currentVersion- the current version of the plugin as a StringpluginName- the name of the plugin the version fetch is associated withresourceId- the resource ID of the plugin on the platformresourceURL- the URL of the resource; if null, a default URL is generated based on the resourceId
-