From: David ‘Bombe’ Roden Date: Sat, 16 Oct 2010 01:35:19 +0000 (+0200) Subject: Add method to load a Sone from a URI. X-Git-Tag: 0.1-RC1~297 X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=commitdiff_plain;h=31f21e1186f3a60467aea23a066c898f57f0993c Add method to load a Sone from a URI. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 0091265..3aab417 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -39,6 +39,7 @@ import net.pterodactylus.util.config.Configuration; import net.pterodactylus.util.config.ConfigurationException; import net.pterodactylus.util.logging.Logging; import net.pterodactylus.util.service.AbstractService; +import freenet.client.FetchResult; import freenet.keys.FreenetURI; /** @@ -281,6 +282,20 @@ public class Core extends AbstractService { } /** + * Loads the Sone from the given request URI. + * + * @param requestUri + * The request URI to load the Sone from + */ + public void loadSone(String requestUri) { + try { + FetchResult fetchResult = freenetInterface.fetchUri(new FreenetURI(requestUri).setMetaString(new String[] { "sone.xml" })); + } catch (MalformedURLException mue1) { + logger.log(Level.INFO, "Could not create URI from “" + requestUri + "”.", mue1); + } + } + + /** * Deletes the given Sone from this plugin instance. * * @param sone