From 04f83e3b539c6a20ce819bbe4f66c1996e7169f7 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Tue, 1 Jan 2013 20:11:39 +0100
Subject: [PATCH] Cache: optional path argument for getCache/Scanner/etc

---
 lib/files/storage/common.php  | 11 ++++-------
 lib/files/storage/storage.php | 12 ++++++++----
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php
index ab167f2864..e859d447f3 100644
--- a/lib/files/storage/common.php
+++ b/lib/files/storage/common.php
@@ -237,22 +237,19 @@ abstract class Common implements \OC\Files\Storage\Storage {
 		return $this->filemtime($path)>$time;
 	}
 
-	public function getCache(){
+	public function getCache($path=''){
 		return new \OC\Files\Cache\Cache($this);
 	}
 
-	public function getScanner(){
+	public function getScanner($path=''){
 		return new \OC\Files\Cache\Scanner($this);
 	}
 
-	public function getPermissionsCache(){
+	public function getPermissionsCache($path=''){
 		return new \OC\Files\Cache\Permissions($this);
 	}
 
-	/**
-	 * @return \OC\Files\Cache\Watcher
-	 */
-	public function getWatcher(){
+	public function getWatcher($path=''){
 		return new \OC\Files\Cache\Watcher($this);
 	}
 
diff --git a/lib/files/storage/storage.php b/lib/files/storage/storage.php
index b603381dc9..2cc835236b 100644
--- a/lib/files/storage/storage.php
+++ b/lib/files/storage/storage.php
@@ -54,25 +54,29 @@ interface Storage{
 	public function hasUpdated($path,$time);
 
 	/**
+	 * @param string $path
 	 * @return \OC\Files\Cache\Cache
 	 */
-	public function getCache();
+	public function getCache($path='');
 	/**
+	 * @param string $path
 	 * @return \OC\Files\Cache\Scanner
 	 */
-	public function getScanner();
+	public function getScanner($path='');
 
 	public function getOwner($path);
 
 	/**
+	 * @param string $path
 	 * @return \OC\Files\Cache\Permissions
 	 */
-	public function getPermissionsCache();
+	public function getPermissionsCache($path='');
 
 	/**
+	 * @param string $path
 	 * @return \OC\Files\Cache\Watcher
 	 */
-	public function getWatcher();
+	public function getWatcher($path='');
 
 	/**
 	 * get the ETag for a file or folder
-- 
GitLab