|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectme.armar.plugins.autorank.updater.Updater
public class Updater
Check dev.bukkit.org to find updates for a given plugin, and download the updates if needed.
VERY, VERY IMPORTANT: Because there are no standards for adding auto-update toggles in your plugin's config, this system provides NO CHECK WITH YOUR CONFIG to make sure the user has allowed auto-updating.
| Nested Class Summary | |
|---|---|
static class |
Updater.UpdateResult
Gives the dev the result of the update process. |
private class |
Updater.UpdateRunnable
|
static class |
Updater.UpdateType
Allows the dev to specify the type of update that will be run. |
| Field Summary | |
|---|---|
private boolean |
announce
|
private java.lang.String |
apiKey
|
private static int |
BYTE_SIZE
|
private org.bukkit.configuration.file.YamlConfiguration |
config
|
private java.io.File |
file
|
private static java.lang.String |
HOST
|
private int |
id
|
private static java.lang.String |
LINK_VALUE
|
private static java.lang.String[] |
NO_UPDATE_TAG
|
private org.bukkit.plugin.Plugin |
plugin
|
private static java.lang.String |
QUERY
|
private Updater.UpdateResult |
result
|
private java.lang.Thread |
thread
|
private static java.lang.String |
TITLE_VALUE
|
private Updater.UpdateType |
type
|
private static java.lang.String |
TYPE_VALUE
|
private java.lang.String |
updateFolder
|
private java.net.URL |
url
|
private static java.lang.String |
VERSION_VALUE
|
private java.lang.String |
versionGameVersion
|
private java.lang.String |
versionLink
|
private java.lang.String |
versionName
|
private java.lang.String |
versionType
|
| Constructor Summary | |
|---|---|
Updater(org.bukkit.plugin.Plugin plugin,
int id,
java.io.File file,
Updater.UpdateType type,
boolean announce)
Initialize the updater |
|
| Method Summary | |
|---|---|
java.lang.String |
getLatestFileLink()
Get the latest version's file link. |
java.lang.String |
getLatestGameVersion()
Get the latest version's game version. |
java.lang.String |
getLatestName()
Get the latest version's name. |
java.lang.String |
getLatestType()
Get the latest version's release type (release, beta, or alpha). |
Updater.UpdateResult |
getResult()
Get the result of the update process. |
private boolean |
hasTag(java.lang.String version)
Evaluate whether the version number is marked showing that it should not be updated by this program |
private boolean |
pluginFile(java.lang.String name)
Check if the name of a jar is one of the plugins currently installed, used for extracting the correct files out of a zip. |
private boolean |
read()
|
private void |
saveFile(java.io.File folder,
java.lang.String file,
java.lang.String u)
Save an update from dev.bukkit.org into the server's update folder. |
private void |
unzip(java.lang.String file)
Part of Zip-File-Extractor, modified by Gravity for use with Bukkit |
private boolean |
versionCheck(java.lang.String title)
Check to see if the program should continue by evaluation whether the plugin is already updated, or shouldn't be updated |
private void |
waitForThread()
As the result of Updater output depends on the thread's completion, it is necessary to wait for the thread to finish before allowing anyone to check the result. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private org.bukkit.plugin.Plugin plugin
private Updater.UpdateType type
private java.lang.String versionName
private java.lang.String versionLink
private java.lang.String versionType
private java.lang.String versionGameVersion
private boolean announce
private java.net.URL url
private java.io.File file
private java.lang.Thread thread
private int id
private java.lang.String apiKey
private static final java.lang.String TITLE_VALUE
private static final java.lang.String LINK_VALUE
private static final java.lang.String TYPE_VALUE
private static final java.lang.String VERSION_VALUE
private static final java.lang.String QUERY
private static final java.lang.String HOST
private static final java.lang.String[] NO_UPDATE_TAG
private static final int BYTE_SIZE
private org.bukkit.configuration.file.YamlConfiguration config
private java.lang.String updateFolder
private Updater.UpdateResult result
| Constructor Detail |
|---|
public Updater(org.bukkit.plugin.Plugin plugin,
int id,
java.io.File file,
Updater.UpdateType type,
boolean announce)
plugin - The plugin that is checking for an update.id - The dev.bukkit.org id of the projectfile - The file that the plugin is running from, get this by doing
this.getFile() from within your main class.type - Specify the type of update this will be. See
Updater.UpdateTypeannounce - True if the program should announce the progress of new
updates in console| Method Detail |
|---|
public Updater.UpdateResult getResult()
public java.lang.String getLatestType()
public java.lang.String getLatestGameVersion()
public java.lang.String getLatestName()
public java.lang.String getLatestFileLink()
private void waitForThread()
private void saveFile(java.io.File folder,
java.lang.String file,
java.lang.String u)
private void unzip(java.lang.String file)
private boolean pluginFile(java.lang.String name)
private boolean versionCheck(java.lang.String title)
private boolean hasTag(java.lang.String version)
private boolean read()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||