From de5b7609f96e166b96b7380e62d32ac51d85d50f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 17 May 2016 21:40:55 +0200 Subject: use mount providers to setup home storages (#24567) --- lib/public/files/config/ihomemountprovider.php | 43 ++++++++++++++++++++++ .../files/config/imountprovidercollection.php | 17 +++++++++ 2 files changed, 60 insertions(+) create mode 100644 lib/public/files/config/ihomemountprovider.php (limited to 'lib/public/files') diff --git a/lib/public/files/config/ihomemountprovider.php b/lib/public/files/config/ihomemountprovider.php new file mode 100644 index 00000000000..bedcd3cfacc --- /dev/null +++ b/lib/public/files/config/ihomemountprovider.php @@ -0,0 +1,43 @@ + + * @author Robin Appelman + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ + +namespace OCP\Files\Config; + +use OCP\Files\Storage\IStorageFactory; +use OCP\IUser; + +/** + * Provides + * + * @since 9.1.0 + */ +interface IHomeMountProvider { + /** + * Get all mountpoints applicable for the user + * + * @param \OCP\IUser $user + * @param \OCP\Files\Storage\IStorageFactory $loader + * @return \OCP\Files\Mount\IMountPoint|null + * @since 9.1.0 + */ + public function getHomeMountForUser(IUser $user, IStorageFactory $loader); +} diff --git a/lib/public/files/config/imountprovidercollection.php b/lib/public/files/config/imountprovidercollection.php index 39da61812a9..29208cb6f53 100644 --- a/lib/public/files/config/imountprovidercollection.php +++ b/lib/public/files/config/imountprovidercollection.php @@ -39,6 +39,15 @@ interface IMountProviderCollection { */ public function getMountsForUser(IUser $user); + /** + * Get the configured home mount for this user + * + * @param \OCP\IUser $user + * @return \OCP\Files\Mount\IMountPoint + * @since 9.1.0 + */ + public function getHomeMountForUser(IUser $user); + /** * Add a provider for mount points * @@ -47,6 +56,14 @@ interface IMountProviderCollection { */ public function registerProvider(IMountProvider $provider); + /** + * Add a provider for home mount points + * + * @param \OCP\Files\Config\IHomeMountProvider $provider + * @since 9.1.0 + */ + public function registerHomeProvider(IHomeMountProvider $provider); + /** * Get the mount cache which can be used to search for mounts without setting up the filesystem * -- cgit v1.2.3