X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FSoneDownloaderImpl.java;h=f3d5068d7bbb61cd7d598e3071e52af1257982b3;hp=8470e49dffe0dea36aefbd977de7e0758a5005a6;hb=2493e844ddeece59211c6a3c40e7ecc5d2cdb8b5;hpb=c8b9bb56bd7a73e39565fd577e14f8d5e1215c5d diff --git a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java index 8470e49..f3d5068 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java @@ -44,8 +44,6 @@ import freenet.keys.USK; import freenet.node.RequestStarter; import freenet.support.api.Bucket; -import com.google.common.annotations.VisibleForTesting; - /** * The Sone downloader is responsible for download Sones as they are updated. * @@ -76,22 +74,9 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade * The core * @param freenetInterface * The Freenet interface - */ - @Inject - public SoneDownloaderImpl(Core core, FreenetInterface freenetInterface) { - this(core, freenetInterface, new SoneParser(core)); - } - - /** - * Creates a new Sone downloader. - * - * @param core - * The core - * @param freenetInterface - * The Freenet interface * @param soneParser */ - @VisibleForTesting + @Inject SoneDownloaderImpl(Core core, FreenetInterface freenetInterface, SoneParser soneParser) { super("Sone Downloader", false); this.core = core; @@ -127,7 +112,7 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade sone, key, newKnownGood, newSlotToo)); if (edition > sone.getLatestEdition()) { sone.setLatestEdition(edition); - new Thread(fetchSoneAction(sone), + new Thread(fetchSoneAsSskAction(sone), "Sone Downloader").start(); } } @@ -155,7 +140,7 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade return (currentTimeMillis() - sone.getTime()) < DAYS.toMillis(7); } - private void fetchSone(Sone sone) { + private void fetchSoneAsSsk(Sone sone) { fetchSone(sone, sone.getRequestUri().sskForUSK(), false); } @@ -231,7 +216,7 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade } @Override - public Runnable fetchSoneWithUriAction(final Sone sone) { + public Runnable fetchSoneAsUskAction(final Sone sone) { return new Runnable() { @Override public void run() { @@ -241,11 +226,11 @@ public class SoneDownloaderImpl extends AbstractService implements SoneDownloade } @Override - public Runnable fetchSoneAction(final Sone sone) { + public Runnable fetchSoneAsSskAction(final Sone sone) { return new Runnable() { @Override public void run() { - fetchSone(sone); + fetchSoneAsSsk(sone); } }; }