X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FSoneRescuer.java;h=173a67e4e18d22c2d6e01ea16bf332f7be32a839;hb=1380d276bf5886e320f89cea232a6db7e4cdb7b8;hp=542ec4aa69596c609af5d0159afa56ca77641016;hpb=0df5e91852f737d760c5a9f54c5667309fbadcc2;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/core/SoneRescuer.java b/src/main/java/net/pterodactylus/sone/core/SoneRescuer.java index 542ec4a..173a67e 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneRescuer.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneRescuer.java @@ -1,5 +1,5 @@ /* - * Sone - SoneRescuer.java - Copyright © 2011 David Roden + * Sone - SoneRescuer.java - Copyright © 2011–2013 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 @@ -17,6 +17,8 @@ package net.pterodactylus.sone.core; +import static net.pterodactylus.sone.data.Sone.TO_FREENET_URI; + import net.pterodactylus.sone.data.Sone; import net.pterodactylus.util.service.AbstractService; import freenet.keys.FreenetURI; @@ -62,7 +64,7 @@ public class SoneRescuer extends AbstractService { this.core = core; this.soneDownloader = soneDownloader; this.sone = sone; - currentEdition = sone.getRequestUri().getEdition(); + currentEdition = TO_FREENET_URI.apply(sone).getEdition(); } // @@ -146,9 +148,6 @@ public class SoneRescuer extends AbstractService { // SERVICE METHODS // - /** - * {@inheritDoc} - */ @Override protected void serviceRun() { while (!shouldStop()) { @@ -157,7 +156,7 @@ public class SoneRescuer extends AbstractService { } if (fetching) { core.lockSone(sone); - FreenetURI soneUri = sone.getRequestUri().setKeyType("SSK").setDocName("Sone-" + currentEdition).setMetaString(new String[] { "sone.xml" }); + FreenetURI soneUri = TO_FREENET_URI.apply(sone).setKeyType("SSK").setDocName("Sone-" + currentEdition).setMetaString(new String[] { "sone.xml" }); System.out.println("URI: " + soneUri); Sone fetchedSone = soneDownloader.fetchSone(sone, soneUri, true); System.out.println("Sone: " + fetchedSone);