webdav: introduce MoveOptions

This commit is contained in:
Simon Ser
2024-01-18 13:25:14 +01:00
parent 790ebfc5f8
commit b821d8c1ea
4 changed files with 17 additions and 6 deletions

View File

@@ -214,7 +214,7 @@ func (fs LocalFileSystem) Copy(ctx context.Context, src, dst string, options *Co
return created, nil
}
func (fs LocalFileSystem) Move(ctx context.Context, src, dst string, overwrite bool) (created bool, err error) {
func (fs LocalFileSystem) Move(ctx context.Context, src, dst string, options *MoveOptions) (created bool, err error) {
srcPath, err := fs.localPath(src)
if err != nil {
return false, err
@@ -230,7 +230,7 @@ func (fs LocalFileSystem) Move(ctx context.Context, src, dst string, overwrite b
}
created = true
} else {
if !overwrite {
if options.NoOverwrite {
return false, os.ErrExist
}
if err := os.RemoveAll(dstPath); err != nil {