2018-04-30 10:29:56 -04:00
|
|
|
<?php
|
|
|
|
|
/**
|
2024-05-27 11:39:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2018-04-30 10:29:56 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCA\CloudFederationAPI;
|
2020-04-09 05:48:10 -04:00
|
|
|
|
2018-06-13 08:46:23 -04:00
|
|
|
use OCP\Federation\ICloudFederationProviderManager;
|
2018-04-30 10:29:56 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class config
|
|
|
|
|
*
|
|
|
|
|
* handles all the config parameters
|
|
|
|
|
*
|
|
|
|
|
* @package OCA\CloudFederationAPI
|
|
|
|
|
*/
|
|
|
|
|
class Config {
|
|
|
|
|
|
2018-06-13 08:46:23 -04:00
|
|
|
/** @var ICloudFederationProviderManager */
|
|
|
|
|
private $cloudFederationProviderManager;
|
2018-06-12 10:58:30 -04:00
|
|
|
|
2018-06-13 08:46:23 -04:00
|
|
|
public function __construct(ICloudFederationProviderManager $cloudFederationProviderManager) {
|
|
|
|
|
$this->cloudFederationProviderManager = $cloudFederationProviderManager;
|
2018-04-30 10:29:56 -04:00
|
|
|
}
|
|
|
|
|
|
2018-06-13 08:46:23 -04:00
|
|
|
/**
|
|
|
|
|
* get a list of supported share types
|
|
|
|
|
*
|
|
|
|
|
* @param string $resourceType
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
|
|
|
|
public function getSupportedShareTypes($resourceType) {
|
2018-06-13 08:19:59 -04:00
|
|
|
try {
|
|
|
|
|
$provider = $this->cloudFederationProviderManager->getCloudFederationProvider($resourceType);
|
|
|
|
|
return $provider->getSupportedShareTypes();
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
2018-04-30 10:29:56 -04:00
|
|
|
}
|
|
|
|
|
}
|