return 'shared::' . md5($this->token . '@' . $this->remote);
}
- public function getCache($path = '') {
- if (!isset($this->cache)) {
+ public function getCache($path = '', $storage = null) {
+ if (!$storage) {
$this->cache = new Cache($this, $this->remote, $this->remoteUser);
}
return $this->cache;
/**
* @param string $path
+ * @param \OC\Files\Storage\Storage $storage
* @return \OCA\Files_Sharing\External\Scanner
*/
- public function getScanner($path = '') {
+ public function getScanner($path = '', $storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
if (!isset($this->scanner)) {
- $this->scanner = new Scanner($this);
+ $this->scanner = new Scanner($storage);
}
return $this->scanner;
}
return $this->filemtime($path) > $time;
}
- public function getCache($path = '') {
- return new \OC\Files\Cache\Shared_Cache($this);
+ public function getCache($path = '', $storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
+ return new \OC\Files\Cache\Shared_Cache($storage);
}
- public function getScanner($path = '') {
- return new \OC\Files\Cache\Scanner($this);
+ public function getScanner($path = '', $storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
+ return new \OC\Files\Cache\Scanner($storage);
}
- public function getWatcher($path = '') {
- return new \OC\Files\Cache\Shared_Watcher($this);
+ public function getWatcher($path = '', $storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
+ return new \OC\Files\Cache\Shared_Watcher($storage);
}
public function getOwner($path) {
return $this->filemtime($path) > $time;
}
- public function getCache($path = '') {
+ public function getCache($path = '', $storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
if (!isset($this->cache)) {
- $this->cache = new \OC\Files\Cache\Cache($this);
+ $this->cache = new \OC\Files\Cache\Cache($storage);
}
return $this->cache;
}
- public function getScanner($path = '') {
+ public function getScanner($path = '', $storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
if (!isset($this->scanner)) {
- $this->scanner = new \OC\Files\Cache\Scanner($this);
+ $this->scanner = new \OC\Files\Cache\Scanner($storage);
}
return $this->scanner;
}
- public function getWatcher($path = '') {
+ public function getWatcher($path = '', $storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
if (!isset($this->watcher)) {
- $this->watcher = new \OC\Files\Cache\Watcher($this);
+ $this->watcher = new \OC\Files\Cache\Watcher($storage);
$this->watcher->setPolicy(\OC::$server->getConfig()->getSystemValue('filesystem_check_changes', Watcher::CHECK_ONCE));
}
return $this->watcher;
}
- public function getStorageCache() {
+ public function getStorageCache($storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
if (!isset($this->storageCache)) {
- $this->storageCache = new \OC\Files\Cache\Storage($this);
+ $this->storageCache = new \OC\Files\Cache\Storage($storage);
}
return $this->storageCache;
}
/**
* @return \OC\Files\Cache\HomeCache
*/
- public function getCache($path = '') {
+ public function getCache($path = '', $storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
if (!isset($this->cache)) {
- $this->cache = new \OC\Files\Cache\HomeCache($this);
+ $this->cache = new \OC\Files\Cache\HomeCache($storage);
}
return $this->cache;
}
* get a cache instance for the storage
*
* @param string $path
+ * @param \OC\Files\Storage\Storage (optional) the storage to pass to the cache
* @return \OC\Files\Cache\Cache
*/
- public function getCache($path = '');
+ public function getCache($path = '', $storage = null);
/**
* get a scanner instance for the storage
*
* @param string $path
+ * @param \OC\Files\Storage\Storage (optional) the storage to pass to the scanner
* @return \OC\Files\Cache\Scanner
*/
- public function getScanner($path = '');
+ public function getScanner($path = '', $storage = null);
/**
* get a watcher instance for the cache
*
* @param string $path
+ * @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher
* @return \OC\Files\Cache\Watcher
*/
- public function getWatcher($path = '');
+ public function getWatcher($path = '', $storage = null);
/**
* @return \OC\Files\Cache\Storage
* get a cache instance for the storage
*
* @param string $path
+ * @param \OC\Files\Storage\Storage (optional) the storage to pass to the cache
* @return \OC\Files\Cache\Cache
*/
- public function getCache($path = '') {
- return $this->storage->getCache($path);
+ public function getCache($path = '', $storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
+ return $this->storage->getCache($path, $storage);
}
/**
* get a scanner instance for the storage
*
* @param string $path
+ * @param \OC\Files\Storage\Storage (optional) the storage to pass to the scanner
* @return \OC\Files\Cache\Scanner
*/
- public function getScanner($path = '') {
- return $this->storage->getScanner($path);
+ public function getScanner($path = '', $storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
+ return $this->storage->getScanner($path, $storage);
}
* get a watcher instance for the cache
*
* @param string $path
+ * @param \OC\Files\Storage\Storage (optional) the storage to pass to the watcher
* @return \OC\Files\Cache\Watcher
*/
- public function getWatcher($path = '') {
- return $this->storage->getWatcher($path);
+ public function getWatcher($path = '', $storage = null) {
+ if (!$storage) {
+ $storage = $this;
+ }
+ return $this->storage->getWatcher($path, $storage);
}
/**
/**
* Returns true
+ *
* @return true
*/
public function test() {
/**
* Returns the wrapped storage's value for isLocal()
+ *
* @return bool wrapped storage's isLocal() value
*/
public function isLocal() {