SourceForge.net Latest.File.Checker

How you use it:

Put the jar files on the classpath of your application.
These are:

The parameters are set in the file 'config.xml'.
Here is an example:

<?xml version="1.0"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<entry key="current.version"></entry>
	<entry key="rss.url">http://sourceforge.net/api/file/index/project-id/273173/mtime/desc/rss</entry>
	<entry key="regex">.*Wallpaper-Changer-([0-9]+\.[0-9]+(\.[0-9]+)?)_win32.exe.*</entry>
</properties>

The simplest code is this:

LatestFilesMain l = new LatestFilesMain();
if (l.update()) {
	URL url = l.getLatest();
	if (JOptionPane.showConfirmDialog(null, "A new version of the Wallpaper Changer is available!\nDo you wan't to download it now?", "New Version", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.YES_OPTION) {
		Desktop.getDesktop().browse(url.toURI());
	}
}

This code check for 'update()' and then shows a dialog that asks to download the new version.


Stefan Dotti, www.dotti.at, sourceforge.net/projects/sf-filechecker, sourceforge.net/users/stefandotti