diff --git a/adapter/http/system.go b/adapter/http/system.go index e243037..f697c5c 100644 --- a/adapter/http/system.go +++ b/adapter/http/system.go @@ -3,15 +3,17 @@ package http import ( "context" "github.com/viant/afs" + "github.com/viant/afs/url" "net/http" ) type Filesystem struct { - fs afs.Service + fs afs.Service + dir string } func (f *Filesystem) Open(name string) (http.File, error) { - object, err := f.fs.Object(context.Background(), name) + object, err := f.fs.Object(context.Background(), url.Join(f.dir, name)) if err != nil { return nil, err } @@ -19,6 +21,6 @@ func (f *Filesystem) Open(name string) (http.File, error) { } // New creates http filesystem -func New(fs afs.Service) http.FileSystem { - return &Filesystem{fs: fs} +func New(fs afs.Service, dir string) http.FileSystem { + return &Filesystem{fs: fs, dir: dir} }