use of org.jivesoftware.sparkimpl.updater.CheckUpdates in project Spark by igniterealtime.
the class MainWindow method checkForUpdates.
/**
* Checks for the latest update on the server.
*
* @param forced true if you want to bypass the normal checking security.
*/
private void checkForUpdates(final boolean forced) {
final CheckUpdates updater = new CheckUpdates();
try {
final SwingWorker updateThread = new SwingWorker() {
@Override
public Object construct() {
try {
Thread.sleep(50);
} catch (InterruptedException e) {
Log.error(e);
}
return "ok";
}
@Override
public void finished() {
try {
updater.checkForUpdate(forced);
} catch (Exception e) {
Log.error("There was an error while checking for a new update.", e);
}
}
};
updateThread.start();
} catch (Exception e) {
Log.warning("Error updating.", e);
}
}
Aggregations