+ /**
+ * Creates a key pair.
+ *
+ * @return The request key at index 0, the insert key at index 1
+ */
+ public String[] generateKeyPair() {
+ FreenetURI[] keyPair = client.generateKeyPair("");
+ 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);
+ }
+ }
+