}
/**
+ * 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)}.
*
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? */