From 71fdaa42386173da7bfa13f1728c394aeeb4eb01 Mon Sep 17 00:00:00 2001 From: Lewis Marshall Date: Thu, 6 Apr 2017 23:22:22 +0100 Subject: swarm/api: refactor and improve HTTP API (#3773) This PR deprecates the file related RPC calls in favour of an improved HTTP API. The main aim is to expose a simple to use API which can be consumed by thin clients (e.g. curl and HTML forms) without the need for complex logic (e.g. manipulating prefix trie manifests). --- swarm/api/swarmfs_unix.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'swarm/api/swarmfs_unix.go') diff --git a/swarm/api/swarmfs_unix.go b/swarm/api/swarmfs_unix.go index e696c6b9a..a704c1ec2 100644 --- a/swarm/api/swarmfs_unix.go +++ b/swarm/api/swarmfs_unix.go @@ -91,11 +91,16 @@ func (self *SwarmFS) Mount(mhash, mountpoint string) (*MountInfo, error) { return nil, fmt.Errorf("%s is already mounted", cleanedMountPoint) } - key, _, path, err := self.swarmApi.parseAndResolve(mhash, true) + uri, err := Parse("bzz:/" + mhash) if err != nil { - return nil, fmt.Errorf("can't resolve %q: %v", mhash, err) + return nil, err + } + key, err := self.swarmApi.Resolve(uri) + if err != nil { + return nil, err } + path := uri.Path if len(path) > 0 { path += "/" } -- cgit v1.2.3