diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-04-18 21:03:16 +0200 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-04-19 14:04:00 +0200 |
commit | f27d7cbf996a80b1dc1087f5275291f9d938faac (patch) | |
tree | db077ae94de0fed7e143ad1388627e813e02810c /lib/private | |
parent | 2f1c62ce0b022a2549ff80a299b8a3b314106fae (diff) | |
download | nextcloud-server-f27d7cbf996a80b1dc1087f5275291f9d938faac.tar.gz nextcloud-server-f27d7cbf996a80b1dc1087f5275291f9d938faac.zip |
Move copy- and moveFromStorage to jail
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/files/storage/wrapper/jail.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/private/files/storage/wrapper/jail.php b/lib/private/files/storage/wrapper/jail.php index 17558170265..e8063f670c5 100644 --- a/lib/private/files/storage/wrapper/jail.php +++ b/lib/private/files/storage/wrapper/jail.php @@ -460,4 +460,30 @@ class Jail extends Wrapper { public function resolvePath($path) { return [$this->storage, $this->getSourcePath($path)]; } + + /** + * @param \OCP\Files\Storage $sourceStorage + * @param string $sourceInternalPath + * @param string $targetInternalPath + * @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, $this->getSourcePath($targetInternalPath)); + } + + /** + * @param \OCP\Files\Storage $sourceStorage + * @param string $sourceInternalPath + * @param string $targetInternalPath + * @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, $this->getSourcePath($targetInternalPath)); + } } |