sears.tools
Class Updater

java.lang.Object
  extended by sears.tools.Updater

public class Updater
extends java.lang.Object

Class Updater.
Summary:
This class permit to know if Sears has an available update.


Field Summary
static java.lang.String DEFAULT_UPDATE_ADDRESS
          The default update address
 
Constructor Summary
Updater(javax.swing.JFrame parent, java.lang.String address, double currentVersion)
          Constructor Updater.
 
Method Summary
 java.lang.String getAddressText()
          Method getAddressText.
protected  double getAddressVersion()
          Method getAddressVersion.
protected  void showUpdateAvailableMessage(double version)
          Method showUpdateAvailableMessage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_UPDATE_ADDRESS

public static final java.lang.String DEFAULT_UPDATE_ADDRESS
The default update address

See Also:
Constant Field Values
Constructor Detail

Updater

public Updater(javax.swing.JFrame parent,
               java.lang.String address,
               double currentVersion)
Constructor Updater.
Summary:
Constructor of the class. This will launch a thread that try to read the given address and retrieve the version. If given version is lower that the one found at the given adress, it will show a message dialog.

Parameters:
address - The address to look for the newest version number.
currentVersion - The current version.
Method Detail

showUpdateAvailableMessage

protected void showUpdateAvailableMessage(double version)
Method showUpdateAvailableMessage.
Summary:
This method displays a message to the user about the new available version.

Parameters:
version - The new version available.

getAddressVersion

protected double getAddressVersion()
Method getAddressVersion.
Summary:
This method retrieve the version at the updater address.

Returns:
double The found version, or -1 if an error occurs.

getAddressText

public java.lang.String getAddressText()
Method getAddressText.
Summary:
This method get the text at a given internet address. or "" if an error occurs.

Returns:
String The text found at the address.