mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
XL/Multipart: rename the parts instead of concatenating. (#1416)
This commit is contained in:
committed by
Harshavardhana
parent
39df425b2a
commit
7066ce5160
22
xl-v1.go
22
xl-v1.go
@@ -570,3 +570,25 @@ func (xl XL) DeleteFile(volume, path string) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// RenameFile - rename file.
|
||||
func (xl XL) RenameFile(srcVolume, srcPath, dstVolume, dstPath string) error {
|
||||
if !isValidVolname(srcVolume) {
|
||||
return errInvalidArgument
|
||||
}
|
||||
if !isValidPath(srcPath) {
|
||||
return errInvalidArgument
|
||||
}
|
||||
if !isValidVolname(dstVolume) {
|
||||
return errInvalidArgument
|
||||
}
|
||||
if !isValidPath(dstPath) {
|
||||
return errInvalidArgument
|
||||
}
|
||||
for _, disk := range xl.storageDisks {
|
||||
if err := disk.RenameFile(srcVolume, srcPath, dstVolume, dstPath); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user