summaryrefslogtreecommitdiffstats
path: root/lib/private/Share20/Manager.php
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-10-24 17:03:36 +0200
committerBjoern Schiessle <bjoern@schiessle.org>2016-11-01 19:54:39 +0100
commit318160647a62386b4fda5c04ddca04673bf97813 (patch)
tree4682a016d1e9e10e827e5fcb1d7781b0066c49b0 /lib/private/Share20/Manager.php
parent96c40d14a1a253974db8cb2a51f227afe5dff7bf (diff)
downloadnextcloud-server-318160647a62386b4fda5c04ddca04673bf97813.tar.gz
nextcloud-server-318160647a62386b4fda5c04ddca04673bf97813.zip
add method to check if a share provider for a given type is loaded
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'lib/private/Share20/Manager.php')
-rw-r--r--lib/private/Share20/Manager.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 19d6151a037..899bd4ebfa1 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -30,6 +30,7 @@ namespace OC\Share20;
use OC\Cache\CappedMemoryCache;
use OC\Files\Mount\MoveableMount;
use OC\HintException;
+use OC\Share20\Exception\ProviderException;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
@@ -1291,4 +1292,17 @@ class Manager implements IManager {
return $this->config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes';
}
+ /**
+ * @inheritdoc
+ */
+ public function shareProviderExists($shareType) {
+ try {
+ $this->factory->getProviderForType($shareType);
+ } catch (ProviderException $e) {
+ return false;
+ }
+
+ return true;
+ }
+
}