Add javadoc comment.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / SoneDownloader.java
index 193d328..b7871dd 100644 (file)
@@ -89,6 +89,18 @@ 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)}.
         *
@@ -102,6 +114,15 @@ public class SoneDownloader extends AbstractService {
                parseSone(sone, fetchResult);
        }
 
+       /**
+        * Parses a Sone from a fetch result.
+        *
+        * @param sone
+        *            The sone to parse, or {@code null} if the Sone is yet unknown
+        * @param fetchResult
+        *            The fetch result
+        * @return The parsed Sone, or {@code null} if the Sone could not be parsed
+        */
        public Sone parseSone(Sone sone, FetchResult fetchResult) {
                logger.log(Level.FINEST, "Persing FetchResult (%d bytes, %s) for %s…", new Object[] { fetchResult.size(), fetchResult.getMimeType(), sone });
                /* TODO - impose a size limit? */