Skip to content

Commit

Permalink
Move moveFromCache to CacheJail
Browse files Browse the repository at this point in the history
  • Loading branch information
rullzer committed Apr 19, 2016
1 parent f27d7cb commit b53d659
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 0 additions & 4 deletions apps/files_sharing/lib/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,4 @@ protected function formatCacheEntry($entry) {
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));
}
}
16 changes: 16 additions & 0 deletions lib/private/files/cache/wrapper/cachejail.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,20 @@ public function getPathById($id) {
$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);
}
}

0 comments on commit b53d659

Please sign in to comment.