|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.quartercode.quarterbukkit.api.Updater
public abstract class Updater
This class is for checking the plugin-versions and updating plugins.
| Field Summary | |
|---|---|
protected org.bukkit.plugin.Plugin |
plugin
|
protected java.lang.String |
slug
|
protected org.bukkit.plugin.Plugin |
updatePlugin
|
| Constructor Summary | |
|---|---|
Updater(org.bukkit.plugin.Plugin plugin,
org.bukkit.plugin.Plugin updatePlugin,
java.lang.String slug)
Creates a new abstract Updater. |
|
| Method Summary | |
|---|---|
protected abstract boolean |
doInstall(java.io.File downloadedFile,
org.bukkit.command.CommandSender causer)
Does some post-installation-activities, like extracting zips or relaoding the plugin. |
boolean |
equals(java.lang.Object obj)
|
void |
extract(java.io.File zip,
java.lang.String zipPath,
java.io.File destinationFile)
Extracts some Files in a zip. |
java.lang.String |
getLatestVersion()
Returns the latest plugin version. |
java.lang.String |
getLatestVersion(org.bukkit.command.CommandSender causer)
Returns the latest plugin version. |
org.bukkit.plugin.Plugin |
getPlugin()
Returns the Plugin which started the updater. |
org.bukkit.plugin.Plugin |
getUpdatePlugin()
Return the Plugin which should be updated. |
int |
hashCode()
|
boolean |
isNewVersionAvaiable()
Returns if a new version is avaiable. |
boolean |
isNewVersionAvaiable(org.bukkit.command.CommandSender causer)
Returns if a new version is avaiable. |
protected abstract java.lang.String |
parseVersion(java.lang.String title)
Parses the version out of the BukkitDev-upload-title. |
java.lang.String |
toString()
|
boolean |
tryInstall()
This method checks the latest plugin-version and updates it if required. |
boolean |
tryInstall(org.bukkit.command.CommandSender causer)
This method checks the latest plugin-version and updates it if required. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final org.bukkit.plugin.Plugin plugin
protected final org.bukkit.plugin.Plugin updatePlugin
protected final java.lang.String slug
| Constructor Detail |
|---|
public Updater(org.bukkit.plugin.Plugin plugin,
org.bukkit.plugin.Plugin updatePlugin,
java.lang.String slug)
plugin - The Plugin which starts the updater.updatePlugin - The Plugin which should be updated.slug - The BukkitDev-slug. Say we have the URL http://dev.bukkit.org/server-mods/quarterbukkit, quarterbukkit is the slug.| Method Detail |
|---|
public org.bukkit.plugin.Plugin getPlugin()
Plugin which started the updater.
Plugin which started the updater.public org.bukkit.plugin.Plugin getUpdatePlugin()
Plugin which should be updated.
Plugin which should be updated.public boolean tryInstall()
public boolean tryInstall(org.bukkit.command.CommandSender causer)
causer - The executor of the action.
public java.lang.String getLatestVersion()
throws java.io.IOException,
javax.xml.stream.XMLStreamException
java.io.IOException - If something goes wrong with the file system.
javax.xml.stream.XMLStreamException - If something goes wrong with the version XML-feed.
public java.lang.String getLatestVersion(org.bukkit.command.CommandSender causer)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
causer - The executor of the action.
java.io.IOException - If something goes wrong with the file system.
javax.xml.stream.XMLStreamException - If something goes wrong with the version XML-feed.protected abstract java.lang.String parseVersion(java.lang.String title)
title - The BukkitDev-upload-title.
public boolean isNewVersionAvaiable()
throws java.io.IOException,
javax.xml.stream.XMLStreamException
java.io.IOException - If something goes wrong with the file system.
javax.xml.stream.XMLStreamException - If something goes wrong with the version XML-feed.
public boolean isNewVersionAvaiable(org.bukkit.command.CommandSender causer)
throws java.io.IOException,
javax.xml.stream.XMLStreamException
causer - The executor of the action.
java.io.IOException - If something goes wrong with the file system.
javax.xml.stream.XMLStreamException - If something goes wrong with the version XML-feed.
protected abstract boolean doInstall(java.io.File downloadedFile,
org.bukkit.command.CommandSender causer)
throws java.io.IOException
downloadedFile - The downloaded file from BukkitDev.causer - The executor of the action.
java.io.IOException - If something goes wrong with the post-installation-activities.
public void extract(java.io.File zip,
java.lang.String zipPath,
java.io.File destinationFile)
throws java.util.zip.ZipException,
java.io.IOException
Files in a zip.
You can use this in doInstall().
zip - The zip as a File.zipPath - The path in the zip file (relative).destinationFile - Where to extract the File.
java.util.zip.ZipException - If something goes wrong in the ZipFile.
java.io.IOException - If something goes wrong with the file system.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||