webdav: rename MoveAll to Move

This commit is contained in:
Simon Ser 2024-01-18 13:22:19 +01:00
parent 4493704689
commit 790ebfc5f8
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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}
}