level, followed by a URI, optionally followed by a sequence of
slash-separated pathnames.
-Note that since tahoe URIs may contain slashes (in particular, dirnode URIs
-contain a FURL, which resembles a regular HTTP URL and starts with pb://),
-when URIs are used in this form, they must be specially quoted. All slashes
-in the URI must be replaced by '!' characters. The intent is to remove this
-unpleasant requirement in a future release: please see ticket #102 for
-details. An example of this sort of directory-URI URL is:
-
- http://localhost:8123/uri/URI%3ADIR%3Apb%3A!!xextf3eap44o3wi27mf7ehiur6wvhzr6%40207.7.153.180%3A56677%2C127.0.0.1%3A56677!vdrive%3Agqu1fub33exw9cu63718yzx6gr/
Now, what can we do with these URLs? By varying the HTTP method
(GET/PUT/POST/DELETE) and by appending a type-indicating query argument, we
def get(nodeurl, root_uri, vdrive_fname, local_file, stdout, stderr):
if nodeurl[-1] != "/":
nodeurl += "/"
- url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
+ url = nodeurl + "uri/%s/" % urllib.quote(root_uri)
if vdrive_fname:
url += urllib.quote(vdrive_fname)
def list(nodeurl, root_uri, vdrive_pathname, stdout, stderr):
if nodeurl[-1] != "/":
nodeurl += "/"
- url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
+ url = nodeurl + "uri/%s/" % urllib.quote(root_uri)
if vdrive_pathname:
url += urllib.quote(vdrive_pathname)
url += "?t=json"
topath = urllib.quote(topath)
if nodeurl[-1] != "/":
nodeurl += "/"
- url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
+ url = nodeurl + "uri/%s/" % urllib.quote(root_uri)
data = urllib.urlopen(url + frompath + "?t=json").read()
nodetype, attrs = simplejson.loads(data)
"""
if nodeurl[-1] != "/":
nodeurl += "/"
- url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
+ url = nodeurl + "uri/%s/" % urllib.quote(root_uri)
if vdrive_fname:
url += urllib.quote(vdrive_fname)
"""
if nodeurl[-1] != "/":
nodeurl += "/"
- url = nodeurl + "uri/%s/" % urllib.quote(root_uri.replace("/","!"))
+ url = nodeurl + "uri/%s/" % urllib.quote(root_uri)
if vdrive_pathname:
url += urllib.quote(vdrive_pathname)