Move moveFromCache to CacheJail

This commit is contained in:
Roeland Jago Douma 2016-04-19 14:03:39 +02:00
parent f27d7cbf99
commit b53d6598f1
No known key found for this signature in database
GPG Key ID: 1E152838F164D13B
2 changed files with 16 additions and 4 deletions

View File

@ -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));
}
}

View File

@ -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);
}
}