diff options
Diffstat (limited to 'lib/private/files/config/mountprovidercollection.php')
-rw-r--r-- | lib/private/files/config/mountprovidercollection.php | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/private/files/config/mountprovidercollection.php b/lib/private/files/config/mountprovidercollection.php index eb61ec3f5d5..acb106f926a 100644 --- a/lib/private/files/config/mountprovidercollection.php +++ b/lib/private/files/config/mountprovidercollection.php @@ -26,6 +26,8 @@ use OC\Hooks\Emitter; use OC\Hooks\EmitterTrait; use OCP\Files\Config\IMountProviderCollection; use OCP\Files\Config\IMountProvider; +use OCP\Files\Config\IUserMountCache; +use OCP\Files\Mount\IMountPoint; use OCP\Files\Storage\IStorageFactory; use OCP\IUser; @@ -43,10 +45,17 @@ class MountProviderCollection implements IMountProviderCollection, Emitter { private $loader; /** + * @var \OCP\Files\Config\IUserMountCache + */ + private $mountCache; + + /** * @param \OCP\Files\Storage\IStorageFactory $loader + * @param IUserMountCache $mountCache */ - public function __construct(IStorageFactory $loader) { + public function __construct(IStorageFactory $loader, IUserMountCache $mountCache) { $this->loader = $loader; + $this->mountCache = $mountCache; } /** @@ -77,4 +86,21 @@ class MountProviderCollection implements IMountProviderCollection, Emitter { $this->providers[] = $provider; $this->emit('\OC\Files\Config', 'registerMountProvider', [$provider]); } + + /** + * Cache mounts for user + * + * @param IUser $user + * @param IMountPoint[] $mountPoints + */ + public function cacheMounts(IUser $user, array $mountPoints) { + $this->mountCache->registerMounts($user, $mountPoints); + } + + /** + * @return IUserMountCache + */ + public function getMountCache() { + return $this->mountCache; + } } |