public class CheckLatestVersion
extends java.util.Observable
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
currentVersion
The current version of the application
|
private int |
latestVersionValue
The calculated value of the latest version.
|
private static org.apache.log4j.Logger |
LOGGER
Logger Instance
|
private static int |
MAX_NEW_FEATURES_MESSAGE_LINES
Maximum number of lines in the upgrade message
|
private NewVersionInformation |
newVersionInformation
Information regarding the newest version.
|
private static java.lang.String |
VERSION_INFO_URL
URL to version information
|
Constructor and Description |
---|
CheckLatestVersion(java.lang.String pCurrentVersion)
Create an instance that will identify if a version newer than the supplied
one exists.
|
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
getVersionInfoFromWebsite()
Download the version history information from the website.
|
void |
run() |
private void |
setupVersionInfo()
Get version information from the website and check if any listed versions
are newer than the current version.
|
private void |
setupVersionMessage(java.lang.String informationFromWebsite)
Determine if a newer version of the application exists and if so setup the
newVersionInformation instance with information regarding the newest
version.
|
private int |
versionParser(java.lang.String version)
Converts a version string MAJOR#.MINOR#.PATCH# into an integer so that
versions can be compared numerically.
|
private static final java.lang.String VERSION_INFO_URL
private static final org.apache.log4j.Logger LOGGER
private static final int MAX_NEW_FEATURES_MESSAGE_LINES
private java.lang.String currentVersion
private int latestVersionValue
private NewVersionInformation newVersionInformation
public CheckLatestVersion(java.lang.String pCurrentVersion)
pCurrentVersion
- The current version (#.#.# format)public void run()
run
in interface java.lang.Runnable
private void setupVersionInfo()
private java.lang.String getVersionInfoFromWebsite()
private void setupVersionMessage(java.lang.String informationFromWebsite)
informationFromWebsite
- Downloadeed version informationprivate int versionParser(java.lang.String version)
version
- The version string (#.#.#)