The {@link com.mucommander.RuntimeConstants#VERSION_URL} URL contains informationabout the latest release of muCommander:
- date of latest release.
- latest official version.
- where to download the latest version from.
This class is used to access those informations and compare them with what is known of the current one, making it possible to notify users of new releases.
Checking for new releases is a fairly straightforward process, and can be done with a few lines of code:
VersionChecker version; try { version = VersionChecker.getInstance(); if(version.isNewVersionAvailable()) System.out.println("A new version of muCommander is available"); else System.out.println("You've got the latest muCommander version"); } catch(Exception e) {System.err.println("An error occured.");}
muCommander is considered up to date if:
- the {@link com.mucommander.RuntimeConstants#VERSION local version} isnot smaller than the remote one.
- the {@link com.mucommander.RuntimeConstants#BUILD_DATE local release date} isnot smaller than the remote one.
While comparing release dates seems a bit odd - after all, if a new version is release, a new version number should be created. However, it's possible to download development versions of the current release, and those might be updated almost daily. Comparing dates makes it possible to automate the whole process without having to worry about out version numbers growing silly.
|
|