mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-26 13:47:40 +00:00
Implementation of Rename method for S3 PublishedStorage. #15
This commit is contained in:
+6
-1
@@ -208,5 +208,10 @@ func (storage *PublishedStorage) Filelist(prefix string) ([]string, error) {
|
||||
|
||||
// RenameFile renames (moves) file
|
||||
func (storage *PublishedStorage) RenameFile(oldName, newName string) error {
|
||||
panic("not implemented yet")
|
||||
err := storage.bucket.Copy(filepath.Join(storage.prefix, oldName), filepath.Join(storage.prefix, newName), storage.acl)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error copying %s -> %s in %s: %s", oldName, newName, storage, err)
|
||||
}
|
||||
|
||||
return storage.Remove(oldName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user