From: David ‘Bombe’ Roden Date: Sat, 3 Mar 2018 08:08:45 +0000 (+0100) Subject: Move Fetched class to top-level X-Git-Tag: v79^2~132 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=35deb522de06ba7d97160445683375cf87529e8d;p=Sone.git Move Fetched class to top-level --- diff --git a/src/main/java/net/pterodactylus/sone/core/Fetched.java b/src/main/java/net/pterodactylus/sone/core/Fetched.java new file mode 100644 index 0000000..d8c12f5 --- /dev/null +++ b/src/main/java/net/pterodactylus/sone/core/Fetched.java @@ -0,0 +1,54 @@ +package net.pterodactylus.sone.core; + +import freenet.client.FetchResult; +import freenet.keys.FreenetURI; + +/** + * Container for a fetched URI and the {@link FetchResult}. + * + * @author David Roden + */ +public class Fetched { + + /** The fetched URI. */ + private final FreenetURI freenetUri; + + /** The fetch result. */ + private final FetchResult fetchResult; + + /** + * Creates a new fetched URI. + * + * @param freenetUri + * The URI that was fetched + * @param fetchResult + * The fetch result + */ + public Fetched(FreenetURI freenetUri, FetchResult fetchResult) { + this.freenetUri = freenetUri; + this.fetchResult = fetchResult; + } + + // + // ACCESSORS + // + + /** + * Returns the fetched URI. + * + * @return The fetched URI + */ + public FreenetURI getFreenetUri() { + return freenetUri; + } + + /** + * Returns the fetch result. + * + * @return The fetch result + */ + public FetchResult getFetchResult() { + return fetchResult; + } + +} diff --git a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java index 7d1b007..838e4b0 100644 --- a/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java +++ b/src/main/java/net/pterodactylus/sone/core/FreenetInterface.java @@ -355,56 +355,6 @@ public class FreenetInterface { } /** - * Container for a fetched URI and the {@link FetchResult}. - * - * @author David Roden - */ - public static class Fetched { - - /** The fetched URI. */ - private final FreenetURI freenetUri; - - /** The fetch result. */ - private final FetchResult fetchResult; - - /** - * Creates a new fetched URI. - * - * @param freenetUri - * The URI that was fetched - * @param fetchResult - * The fetch result - */ - public Fetched(FreenetURI freenetUri, FetchResult fetchResult) { - this.freenetUri = freenetUri; - this.fetchResult = fetchResult; - } - - // - // ACCESSORS - // - - /** - * Returns the fetched URI. - * - * @return The fetched URI - */ - public FreenetURI getFreenetUri() { - return freenetUri; - } - - /** - * Returns the fetch result. - * - * @return The fetch result - */ - public FetchResult getFetchResult() { - return fetchResult; - } - - } - - /** * Callback for USK watcher events. * * @author David ‘Bombe’ Roden diff --git a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java index f3d5068..c50c852 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java @@ -31,7 +31,6 @@ 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; import net.pterodactylus.util.service.AbstractService; diff --git a/src/main/java/net/pterodactylus/sone/core/UpdateChecker.java b/src/main/java/net/pterodactylus/sone/core/UpdateChecker.java index e739a44..ce438e5 100644 --- a/src/main/java/net/pterodactylus/sone/core/UpdateChecker.java +++ b/src/main/java/net/pterodactylus/sone/core/UpdateChecker.java @@ -30,7 +30,6 @@ 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; diff --git a/src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java b/src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java index 283d2e2..812d41f 100644 --- a/src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java +++ b/src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java @@ -31,7 +31,6 @@ import java.util.HashMap; import net.pterodactylus.sone.core.FreenetInterface.BackgroundFetchCallback; import net.pterodactylus.sone.core.FreenetInterface.Callback; -import net.pterodactylus.sone.core.FreenetInterface.Fetched; import net.pterodactylus.sone.core.FreenetInterface.InsertToken; import net.pterodactylus.sone.core.FreenetInterface.InsertTokenSupplier; import net.pterodactylus.sone.core.event.ImageInsertAbortedEvent; diff --git a/src/test/java/net/pterodactylus/sone/core/SoneDownloaderTest.java b/src/test/java/net/pterodactylus/sone/core/SoneDownloaderTest.java index bac5f58..958f852 100644 --- a/src/test/java/net/pterodactylus/sone/core/SoneDownloaderTest.java +++ b/src/test/java/net/pterodactylus/sone/core/SoneDownloaderTest.java @@ -22,7 +22,6 @@ import static org.mockito.Mockito.when; import java.io.IOException; import java.io.InputStream; -import net.pterodactylus.sone.core.FreenetInterface.Fetched; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.data.Sone.SoneStatus; import net.pterodactylus.sone.freenet.wot.Identity; diff --git a/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java b/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java index ad6b331..44f863b 100644 --- a/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java +++ b/src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java @@ -17,7 +17,6 @@ import java.io.IOException; import java.io.InputStream; import net.pterodactylus.sone.core.FreenetInterface.Callback; -import net.pterodactylus.sone.core.FreenetInterface.Fetched; import net.pterodactylus.sone.core.event.UpdateFoundEvent; import net.pterodactylus.util.version.Version;