com.jfw.update
Class UpdateUtils

java.lang.Object
  extended by com.jfw.update.UpdateUtils

public final class UpdateUtils
extends java.lang.Object

Offer utility methods for the update process.


Field Summary
static java.lang.String EXIST_UPDATE_KEY
          Key for HashMap with output data.
static java.lang.String EXIST_UPDATE_OK
          Value of EXIST_UPDATE_KEY.
static java.lang.String FILE_SIZE_KEY
          Key for HashMap with output data.
static java.lang.String UPDATE_URL_KEY
          Key for HashMap with output data.
static java.lang.String UPDATE_VERSION_KEY
          Key for HashMap with output data.
 
Constructor Summary
UpdateUtils()
           
 
Method Summary
static boolean check(java.util.HashMap outputdata, java.util.ArrayList versionList, java.util.ArrayList updateUrlList, java.util.ArrayList fileSizeList)
          Check if exist a newer version.
static java.lang.String getVersion()
          Get the current version of the application.
static java.lang.String getVersion(java.util.HashMap outputdata)
          Get the current version of the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXIST_UPDATE_KEY

public static final java.lang.String EXIST_UPDATE_KEY
Key for HashMap with output data.

See Also:
Constant Field Values

EXIST_UPDATE_OK

public static final java.lang.String EXIST_UPDATE_OK
Value of EXIST_UPDATE_KEY.

See Also:
Constant Field Values

UPDATE_VERSION_KEY

public static final java.lang.String UPDATE_VERSION_KEY
Key for HashMap with output data.

See Also:
Constant Field Values

UPDATE_URL_KEY

public static final java.lang.String UPDATE_URL_KEY
Key for HashMap with output data.

See Also:
Constant Field Values

FILE_SIZE_KEY

public static final java.lang.String FILE_SIZE_KEY
Key for HashMap with output data.

See Also:
Constant Field Values
Constructor Detail

UpdateUtils

public UpdateUtils()
Method Detail

getVersion

public static java.lang.String getVersion(java.util.HashMap outputdata)
                                   throws java.lang.Exception
Get the current version of the application.

Parameters:
outputdata - contains the data used for get the application version.
Returns:
the current application version.
Throws:
java.lang.Exception

getVersion

public static java.lang.String getVersion()
                                   throws java.lang.Exception
Get the current version of the application.

Returns:
the current application version.
Throws:
java.lang.Exception

check

public static boolean check(java.util.HashMap outputdata,
                            java.util.ArrayList versionList,
                            java.util.ArrayList updateUrlList,
                            java.util.ArrayList fileSizeList)
                     throws java.lang.Exception
Check if exist a newer version.

Parameters:
outputdata - contains the data used for get the application version. If a newer version exist the add in this object the keys:
  1. EXIST_UPDATE_KEY, with value EXIST_UPDATE_OK.
  2. UPDATE_VERSION_KEY, with the version number of the new version.
  3. UPDATE_URL_KEY, with the url to use for download the new version.
versionList - the list of the versions of the application.
updateUrlList - the list of the urls for download the versions updates.
Returns:
true if newer version exist, false if not exist.
Throws:
java.lang.Exception