From 790ebfc5f8f59be1c939ec7cd02f942b16a87be5 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 18 Jan 2024 13:22:19 +0100 Subject: [PATCH] webdav: rename MoveAll to Move --- client.go | 4 ++-- fs_local.go | 2 +- server.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client.go b/client.go index 13209d0..57e089d 100644 --- a/client.go +++ b/client.go @@ -278,8 +278,8 @@ func (c *Client) Copy(ctx context.Context, name, dest string, options *CopyOptio return nil } -// MoveAll moves a file. -func (c *Client) MoveAll(ctx context.Context, name, dest string, overwrite bool) error { +// Move moves a file. +func (c *Client) Move(ctx context.Context, name, dest string, overwrite bool) error { req, err := c.ic.NewRequest("MOVE", name, nil) if err != nil { return err diff --git a/fs_local.go b/fs_local.go index 84d38b1..b5a41da 100644 --- a/fs_local.go +++ b/fs_local.go @@ -214,7 +214,7 @@ func (fs LocalFileSystem) Copy(ctx context.Context, src, dst string, options *Co return created, nil } -func (fs LocalFileSystem) MoveAll(ctx context.Context, src, dst string, overwrite bool) (created bool, err error) { +func (fs LocalFileSystem) Move(ctx context.Context, src, dst string, overwrite bool) (created bool, err error) { srcPath, err := fs.localPath(src) if err != nil { return false, err diff --git a/server.go b/server.go index b7eb225..8b93808 100644 --- a/server.go +++ b/server.go @@ -21,7 +21,7 @@ type FileSystem interface { RemoveAll(ctx context.Context, name string) error Mkdir(ctx context.Context, name string) error Copy(ctx context.Context, name, dest string, options *CopyOptions) (created bool, err error) - MoveAll(ctx context.Context, name, dest string, overwrite bool) (created bool, err error) + Move(ctx context.Context, name, dest string, overwrite bool) (created bool, err error) } // Handler handles WebDAV HTTP requests. It can be used to create a WebDAV @@ -243,7 +243,7 @@ func (b *backend) Copy(r *http.Request, dest *internal.Href, recursive, overwrit } func (b *backend) Move(r *http.Request, dest *internal.Href, overwrite bool) (created bool, err error) { - created, err = b.FileSystem.MoveAll(r.Context(), r.URL.Path, dest.Path, overwrite) + created, err = b.FileSystem.Move(r.Context(), r.URL.Path, dest.Path, overwrite) if os.IsExist(err) { return false, &internal.HTTPError{http.StatusPreconditionFailed, err} }