diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-04-19 14:03:39 +0200 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-04-19 14:04:00 +0200 |
commit | b53d6598f10c97318fbf065369f5b097eb134e28 (patch) | |
tree | e8386af78d80efb4ca3e66df70d162bcf9903aec | |
parent | f27d7cbf996a80b1dc1087f5275291f9d938faac (diff) | |
download | nextcloud-server-b53d6598f10c97318fbf065369f5b097eb134e28.tar.gz nextcloud-server-b53d6598f10c97318fbf065369f5b097eb134e28.zip |
Move moveFromCache to CacheJail
-rw-r--r-- | apps/files_sharing/lib/cache.php | 4 | ||||
-rw-r--r-- | lib/private/files/cache/wrapper/cachejail.php | 16 |
2 files changed, 16 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 88d6939012b..4dcdaa892ad 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -102,8 +102,4 @@ class Shared_Cache extends CacheJail { public function clear() { // Not a valid action for Shared Cache } - - public function moveFromCache(\OCP\Files\Cache\ICache $sourceCache, $sourcePath, $targetPath) { - parent::moveFromCache($sourceCache, $sourcePath, $this->storage->getSourcePath($targetPath)); - } } diff --git a/lib/private/files/cache/wrapper/cachejail.php b/lib/private/files/cache/wrapper/cachejail.php index 868e63cdf81..88b0f23a1fc 100644 --- a/lib/private/files/cache/wrapper/cachejail.php +++ b/lib/private/files/cache/wrapper/cachejail.php @@ -281,4 +281,20 @@ class CacheJail extends CacheWrapper { $path = $this->cache->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); + } } |