X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fde%2Ftodesbaum%2Fjsite%2Fapplication%2FUpdateChecker.java;h=0fefcc2f9afa0dfe4b2cdccb4423d13421c3ce08;hb=8bc7a8f2372639a9fbeea34f9cbee9697f34ba3f;hp=276a07b7c2e0de6adfd125d30f290e7df39e330c;hpb=a6bda7a82aa1b2cfd0313fb28d3dcca68ca516c5;p=jSite.git diff --git a/src/de/todesbaum/jsite/application/UpdateChecker.java b/src/de/todesbaum/jsite/application/UpdateChecker.java index 276a07b..0fefcc2 100644 --- a/src/de/todesbaum/jsite/application/UpdateChecker.java +++ b/src/de/todesbaum/jsite/application/UpdateChecker.java @@ -1,5 +1,5 @@ /* - * jSite - UpdateChecker.java - Copyright © 2008–2011 David Roden + * jSite - UpdateChecker.java - Copyright © 2008–2012 David Roden * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,7 +51,7 @@ public class UpdateChecker implements Runnable { private static int counter = 0; /** The edition for the update check URL. */ - private static final int UPDATE_EDITION = 11; + private static final int UPDATE_EDITION = 17; /** The URL for update checks. */ private static final String UPDATE_KEY = "USK@e3myoFyp5avg6WYN16ImHri6J7Nj8980Fm~aQe4EX1U,QvbWT0ImE0TwLODTl7EoJx2NBnwDxTbLTE6zkB-eGPs,AQACAAE"; @@ -180,7 +180,7 @@ public class UpdateChecker implements Runnable { * The edition number * @return The URI for the update file for the given edition */ - private String constructUpdateKey(int edition) { + private static String constructUpdateKey(int edition) { return UPDATE_KEY + "/jSite/" + edition + "/jSite.properties"; } @@ -191,6 +191,7 @@ public class UpdateChecker implements Runnable { /** * {@inheritDoc} */ + @Override public void run() { Connection connection = freenetInterface.getConnection("jSite-" + ++counter + "-UpdateChecker"); try { @@ -215,6 +216,9 @@ public class UpdateChecker implements Runnable { while (!stop) { Message message = client.readMessage(); logger.log(Level.FINEST, "Received message: " + message); + if (message == null) { + break; + } if ("GetFailed".equals(message.getName())) { if ("27".equals(message.get("code"))) { String editionString = message.get("redirecturi").split("/")[2];