=== Adding multiple files or directories to a parent directory at once ===
POST /uri/$DIRCAP/[SUBDIRS..]?t=set_children
+POST /uri/$DIRCAP/[SUBDIRS..]?t=set-children (Tahoe >= v1.6)
This command adds multiple children to a directory in a single operation.
It reads the request body and interprets it as a JSON-encoded description
currently placed here are "linkcrtime" and "linkmotime". For details, see
the section above entitled "Get Information About A File Or Directory (as
JSON)", in the "About the metadata" subsection.
+
+ Note that this command was introduced with the name "set_children", which
+ uses an underscore rather than a hyphen as other multi-word command names
+ do. The variant with a hyphen is now accepted, but clients that desire
+ backward compatibility should continue to use "set_children".
=== Deleting a File or Directory ===
self.POST, self.public_url + "/foo", t="BOGUS")
return d
- def test_POST_set_children(self):
+ def test_POST_set_children(self, command_name="set_children"):
contents9, n9, newuri9 = self.makefile(9)
contents10, n10, newuri10 = self.makefile(10)
contents11, n11, newuri11 = self.makefile(11)
} ]
}""" % (newuri9, newuri10, newuri11)
- url = self.webish_url + self.public_url + "/foo" + "?t=set_children"
+ url = self.webish_url + self.public_url + "/foo" + "?t=" + command_name
d = client.getPage(url, method="POST", postdata=reqbody)
def _then(res):
d.addErrback(self.dump_error)
return d
+ def test_POST_set_children_with_hyphen(self):
+ return self.test_POST_set_children(command_name="set-children")
+
def test_POST_put_uri(self):
contents, n, newuri = self.makefile(8)
d = self.POST(self.public_url + "/foo", t="uri", name="new.txt", uri=newuri)
d = self._POST_start_deep_stats(ctx)
elif t == "stream-manifest":
d = self._POST_stream_manifest(ctx)
- elif t == "set_children":
+ elif t == "set_children" or t == "set-children":
d = self._POST_set_children(req)
else:
raise WebError("POST to a directory with bad t=%s" % t)