summaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/wrapper
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-05-19 14:21:58 +0200
committerRobin Appelman <icewind@owncloud.com>2015-05-19 14:21:58 +0200
commit9c751f1d871179523e55f93777a473e808d4441b (patch)
treee5fd2799530f0c2288216672773ea03be9190bba /lib/private/files/storage/wrapper
parent8f1a609512744f38976582e9e31b2c14c8f90d01 (diff)
downloadnextcloud-server-9c751f1d871179523e55f93777a473e808d4441b.tar.gz
nextcloud-server-9c751f1d871179523e55f93777a473e808d4441b.zip
use copy when doing a crossStorageCopy on the same storage
Diffstat (limited to 'lib/private/files/storage/wrapper')
-rw-r--r--lib/private/files/storage/wrapper/wrapper.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/files/storage/wrapper/wrapper.php b/lib/private/files/storage/wrapper/wrapper.php
index f3dc09db138..14024addec4 100644
--- a/lib/private/files/storage/wrapper/wrapper.php
+++ b/lib/private/files/storage/wrapper/wrapper.php
@@ -513,6 +513,10 @@ class Wrapper implements \OC\Files\Storage\Storage {
* @return bool
*/
public function copyFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
+ if ($sourceStorage === $this) {
+ return $this->copy($sourceInternalPath, $targetInternalPath);
+ }
+
return $this->storage->copyFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
}
@@ -523,6 +527,10 @@ class Wrapper implements \OC\Files\Storage\Storage {
* @return bool
*/
public function moveFromStorage(\OCP\Files\Storage $sourceStorage, $sourceInternalPath, $targetInternalPath) {
+ if ($sourceStorage === $this) {
+ return $this->rename($sourceInternalPath, $targetInternalPath);
+ }
+
return $this->storage->moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
}