X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FSoneDownloaderImpl.java;h=8470e49dffe0dea36aefbd977de7e0758a5005a6;hp=6317abea615423ff79c9a672da4d9aab745006ea;hb=c8b9bb56bd7a73e39565fd577e14f8d5e1215c5d;hpb=419098bcd6215125408b29e60bd888e60979d37b diff --git a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java index 6317abe..8470e49 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java @@ -1,5 +1,5 @@ /* - * Sone - SoneDownloaderImpl.java - Copyright © 2010–2015 David Roden + * Sone - SoneDownloaderImpl.java - Copyright © 2010–2016 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 @@ -29,6 +29,8 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; +import javax.inject.Inject; + import net.pterodactylus.sone.core.FreenetInterface.Fetched; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.data.Sone.SoneStatus; @@ -41,8 +43,6 @@ import freenet.keys.FreenetURI; import freenet.keys.USK; import freenet.node.RequestStarter; import freenet.support.api.Bucket; -import freenet.support.io.Closer; -import com.db4o.ObjectContainer; import com.google.common.annotations.VisibleForTesting; @@ -77,6 +77,7 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade * @param freenetInterface * The Freenet interface */ + @Inject public SoneDownloaderImpl(Core core, FreenetInterface freenetInterface) { this(core, freenetInterface, new SoneParser(core)); } @@ -155,21 +156,7 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade } private void fetchSone(Sone sone) { - fetchSone(sone, sone.getRequestUri().sskForUSK()); - } - - /** - * Fetches the updated Sone. This method can be used to fetch a Sone from a - * specific URI. - * - * @param sone - * The Sone to fetch - * @param soneUri - * The URI to fetch the Sone from - */ - @Override - public void fetchSone(Sone sone, FreenetURI soneUri) { - fetchSone(sone, soneUri, false); + fetchSone(sone, sone.getRequestUri().sskForUSK(), false); } /** @@ -248,7 +235,7 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade return new Runnable() { @Override public void run() { - fetchSone(sone, sone.getRequestUri()); + fetchSone(sone, sone.getRequestUri(), false); } }; }