From 0086803abe9d549c2b26079428c18059347e7a9f Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 19 Apr 2016 14:03:39 +0200 Subject: [PATCH] Move moveFromCache to CacheJail --- lib/private/files/cache/wrapper/cachejail.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/private/files/cache/wrapper/cachejail.php b/lib/private/files/cache/wrapper/cachejail.php index 2e411dedbf24..04a0c138e802 100644 --- a/lib/private/files/cache/wrapper/cachejail.php +++ b/lib/private/files/cache/wrapper/cachejail.php @@ -293,6 +293,22 @@ public function getPathById($id) { return $this->getJailedPath($path); } + /** + * Move a file or folder in the cache + * + * Note that this should make sure the entries are removed from the source cache + * + * @param \OCP\Files\Cache\ICache $sourceCache + * @param string $sourcePath + * @param string $targetPath + */ + public function moveFromCache(\OCP\Files\Cache\ICache $sourceCache, $sourcePath, $targetPath) { + if ($sourceCache === $this) { + return $this->move($sourcePath, $targetPath); + } + return $this->cache->moveFromCache($sourceCache, $sourcePath, $targetPath); + } + protected function getMoveInfo($path) { return [$this->getNumericStorageId(), $this->getSourcePath($path)]; }