package net.pterodactylus.sone.core;
+import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import freenet.client.FetchException;
import freenet.client.FetchResult;
import freenet.client.HighLevelSimpleClient;
+import freenet.client.InsertException;
import freenet.keys.FreenetURI;
import freenet.node.Node;
return new String[] { keyPair[1].toString(), keyPair[0].toString() };
}
+ /**
+ * Inserts a directory into Freenet.
+ *
+ * @param insertUri
+ * The insert URI
+ * @param manifestEntries
+ * The directory entries
+ * @param defaultFile
+ * The name of the default file
+ * @return The generated URI
+ * @throws SoneException
+ * if an insert error occurs
+ */
+ public FreenetURI insertDirectory(FreenetURI insertUri, HashMap<String, Object> manifestEntries, String defaultFile) throws SoneException {
+ try {
+ return client.insertManifest(insertUri, manifestEntries, defaultFile);
+ } catch (InsertException ie1) {
+ throw new SoneException(null, ie1);
+ }
+ }
+
}