boolean showUpdate = false;
prefs.setLastUpdateCheck(System.currentTimeMillis());
prefs.write();
HttpConnection conn = new HttpConnection();
try {
conn.connect(prefs.getUpdateURL());
String line = conn.nextLine();
if (line != null) {
StringTokenizer t = new StringTokenizer(line, " ");
if (t.hasMoreTokens()) {
currentVersion = t.nextToken();
}
if (t.hasMoreTokens()) {
try {
currentReleaseNr = Long.parseLong(t.nextToken());
}
catch (NumberFormatException e) {
}
}
showUpdate = (currentReleaseNr > XNap.RELEASE_NR);
}
StringBuffer sb = new StringBuffer();
String s;
while ((s = conn.nextLine()) != null) {
sb.append(s);
sb.append("\n");
}
info = sb.toString();
return showUpdate;
}
catch (IOException e) {
throw(e);
}
finally {
conn.close();
}
}