Remove unused method.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / SoneDownloader.java
index cffc8d9..decd574 100644 (file)
@@ -105,18 +105,6 @@ public class SoneDownloader extends AbstractService {
        }
 
        /**
-        * Removes the given Sone from the downloader.
-        *
-        * @param sone
-        *            The Sone to stop watching
-        */
-       public void removeSone(Sone sone) {
-               if (sones.remove(sone)) {
-                       freenetInterface.unregisterUsk(sone);
-               }
-       }
-
-       /**
         * Fetches the updated Sone. This method is a callback method for
         * {@link FreenetInterface#registerUsk(Sone, SoneDownloader)}.
         *
@@ -308,16 +296,8 @@ public class SoneDownloader extends AbstractService {
                        }
                }
 
-               String soneInsertUri = soneXml.getValue("insert-uri", null);
-               if ((soneInsertUri != null) && (sone.getInsertUri() == null)) {
-                       try {
-                               sone.setInsertUri(new FreenetURI(soneInsertUri));
-                               sone.setLatestEdition(Math.max(sone.getRequestUri().getEdition(), sone.getInsertUri().getEdition()));
-                       } catch (MalformedURLException mue1) {
-                               /* TODO - mark Sone as bad. */
-                               logger.log(Level.WARNING, String.format("Downloaded Sone %s has invalid insert URI: %s", sone, soneInsertUri), mue1);
-                               return null;
-                       }
+               if (originalSone.getInsertUri() != null) {
+                       sone.setInsertUri(originalSone.getInsertUri());
                }
 
                SimpleXML profileXml = soneXml.getNode("profile");
@@ -541,4 +521,34 @@ public class SoneDownloader extends AbstractService {
                }
        }
 
+       public class FetchSoneWithUri implements Runnable {
+
+               private final Sone sone;
+
+               public FetchSoneWithUri(Sone sone) {
+                       this.sone = sone;
+               }
+
+               @Override
+               public void run() {
+                       fetchSone(sone, sone.getRequestUri());
+               }
+
+       }
+
+       public class FetchSone implements Runnable {
+
+               private final Sone sone;
+
+               public FetchSone(Sone sone) {
+                       this.sone = sone;
+               }
+
+               @Override
+               public void run() {
+                       fetchSone(sone);
+               }
+
+       }
+
 }