Move Fetched class to top-level
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 3 Mar 2018 08:08:45 +0000 (09:08 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 3 Mar 2018 08:11:47 +0000 (09:11 +0100)
src/main/java/net/pterodactylus/sone/core/Fetched.java [new file with mode: 0644]
src/main/java/net/pterodactylus/sone/core/FreenetInterface.java
src/main/java/net/pterodactylus/sone/core/SoneDownloaderImpl.java
src/main/java/net/pterodactylus/sone/core/UpdateChecker.java
src/test/java/net/pterodactylus/sone/core/FreenetInterfaceTest.java
src/test/java/net/pterodactylus/sone/core/SoneDownloaderTest.java
src/test/java/net/pterodactylus/sone/core/UpdateCheckerTest.java

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 (file)
index 0000000..d8c12f5
--- /dev/null
@@ -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 <a href="mailto:d.roden@xplosion.de">David Roden</a>
+ */
+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;
+       }
+
+}
index 7d1b007..838e4b0 100644 (file)
@@ -355,56 +355,6 @@ public class FreenetInterface {
        }
 
        /**
-        * Container for a fetched URI and the {@link FetchResult}.
-        *
-        * @author <a href="mailto:d.roden@xplosion.de">David Roden</a>
-        */
-       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 <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
index f3d5068..c50c852 100644 (file)
@@ -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;
index e739a44..ce438e5 100644 (file)
@@ -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;
index 283d2e2..812d41f 100644 (file)
@@ -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;
index bac5f58..958f852 100644 (file)
@@ -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;
index ad6b331..44f863b 100644 (file)
@@ -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;