[JDEV] Expiry date

Colin Bell colinb at gatewest.co.uk
Wed Jun 18 10:17:59 CDT 2003


Problem solved. Thanks to those who helped out.

I believe I'm off topic here so I wont drag this out. For those 
interested I found an excellent way to do it using the new preferences 
API from Java 1.4.1.
Code example:
Preferences prefs = Preferences.systemNodeForPackage(library.class);
String lastModDate = prefs.get("lastModDate", currDate);
int numberOfDays = prefs.getInt("numberOfDays", 30);
if(!lastModDate.equals(currDate)){
	numberOfDays = numberOfDays - 1;
	prefs.putInt("numberOfDays", numberOfDays);
}

Thanks

Colin




More information about the JDev mailing list