|
|||||||||
| 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 void |
doInstall(java.io.File downloadedFile)
|
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. |
int |
hashCode()
|
boolean |
isNewVersionAvaiable()
Returns if a new version is avaiable. |
protected abstract java.lang.String |
parseVersion(java.lang.String title)
|
java.lang.String |
toString()
|
void |
tryInstall()
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 void tryInstall()
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.protected abstract java.lang.String parseVersion(java.lang.String 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.
protected abstract void doInstall(java.io.File downloadedFile)
throws java.io.IOException
java.io.IOException
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 | ||||||||