/*
- * Sone - UpdateChecker.java - Copyright © 2011–2013 David Roden
+ * Sone - UpdateChecker.java - Copyright © 2011–2015 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
package net.pterodactylus.sone.core;
+import static java.util.logging.Logger.getLogger;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
+import javax.inject.Singleton;
+
import net.pterodactylus.sone.core.FreenetInterface.Fetched;
import net.pterodactylus.sone.core.event.UpdateFoundEvent;
import net.pterodactylus.sone.main.SonePlugin;
import net.pterodactylus.util.io.Closer;
-import net.pterodactylus.util.logging.Logging;
import net.pterodactylus.util.version.Version;
import com.google.common.eventbus.EventBus;
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
+@Singleton
public class UpdateChecker {
/** The logger. */
- private static final Logger logger = Logging.getLogger(UpdateChecker.class);
-
- /** The key of the Sone homepage. */
- private static final String SONE_HOMEPAGE = "USK@nwa8lHa271k2QvJ8aa0Ov7IHAV-DFOCFgmDt3X6BpCI,DuQSUZiI~agF8c-6tjsFFGuZ8eICrzWCILB60nT8KKo,AQACAAE/sone/";
-
- /** The current latest known edition. */
- private static final int LATEST_EDITION = 62;
+ private static final Logger logger = getLogger(UpdateChecker.class.getName());
/** The event bus. */
private final EventBus eventBus;
*/
public void start() {
try {
- currentUri = new FreenetURI(SONE_HOMEPAGE + LATEST_EDITION);
+ currentUri = new FreenetURI(SonePlugin.getHomepage());
} catch (MalformedURLException mue1) {
/* this can not really happen unless I screw up. */
logger.log(Level.SEVERE, "Sone Homepage URI invalid!", mue1);