Replace utils’ Pair by custom containers.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / UpdateChecker.java
index 003e276..5ccc96d 100644 (file)
@@ -26,12 +26,11 @@ import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import net.pterodactylus.sone.core.FreenetInterface.Fetched;
 import net.pterodactylus.sone.main.SonePlugin;
-import net.pterodactylus.util.collection.Pair;
 import net.pterodactylus.util.io.Closer;
 import net.pterodactylus.util.logging.Logging;
 import net.pterodactylus.util.version.Version;
-import freenet.client.FetchResult;
 import freenet.keys.FreenetURI;
 import freenet.support.api.Bucket;
 
@@ -49,7 +48,7 @@ public class UpdateChecker {
        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 = 49;
+       private static final int LATEST_EDITION = 55;
 
        /** The Freenet interface. */
        private final FreenetInterface freenetInterface;
@@ -168,12 +167,12 @@ public class UpdateChecker {
                        public void editionFound(FreenetURI uri, long edition, boolean newKnownGood, boolean newSlot) {
                                logger.log(Level.FINEST, String.format("Found update for %s: %d, %s, %s", uri, edition, newKnownGood, newSlot));
                                if (newKnownGood || newSlot) {
-                                       Pair<FreenetURI, FetchResult> uriResult = freenetInterface.fetchUri(uri.setMetaString(new String[] { "sone.properties" }));
+                                       Fetched uriResult = freenetInterface.fetchUri(uri.setMetaString(new String[] { "sone.properties" }));
                                        if (uriResult == null) {
                                                logger.log(Level.WARNING, String.format("Could not fetch properties of latest homepage: %s", uri));
                                                return;
                                        }
-                                       Bucket resultBucket = uriResult.getRight().asBucket();
+                                       Bucket resultBucket = uriResult.getFetchResult().asBucket();
                                        try {
                                                parseProperties(resultBucket.getInputStream(), edition);
                                                latestEdition = edition;