Skip to content
This repository has been archived by the owner on Jul 4, 2022. It is now read-only.

Utils Updater

Nico edited this page Sep 17, 2020 · 8 revisions

Updater

SimplixCore offers a way for automatic update checks and automatic update installation. This works for every SimplixAppliaction so like SimplixLibraries and Plugins. This will not work for standalone applications.

The update policy

If you want to benefit from SimplixCore's version checking, you need to place a updatepolicy.json file into your resources folder. The file looks like that:

{  
  "versionPattern": "regex-here" // optional, only needed when using non standard versioning scheme  
  "versionFetcherClass": "dev.simplix.core.common.updater.SpigotMcResourceVersionFetcher",  
  "versionFetcher": {  
    "resourceId": "63778"  
  },  
  "updateDownloaderClass": "dev.simplix.core.common.updater.UrlUpdateDownloader", // optional, only needed when you want to automatically install the updates  
  "updateDownloader": { // optional, only needed when you want to automatically install the updates  
    "url": "https://my-file-host.com/myplugin/latest.jar"  
  }  
}

Available version fetchers

Class Purpose
dev.simplix.core.common.updater.SpigotMcResourceVersionFetcher This will fetch the latest version number from a provided SpigotMC.org resource identified with its resourceId
dev.simplix.core.common.updater.UrlVersionFetcher This will fetch the latest version number from a provided url. The response has to be plain text.

Available update downloaders

Class Purpose
dev.simplix.core.common.updater.UrlUpdateDownloader This downloads a binary file from a provided url