1
0

Config.php 818 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\CloudFederationAPI;
  7. use OCP\Federation\ICloudFederationProviderManager;
  8. /**
  9. * Class config
  10. *
  11. * handles all the config parameters
  12. *
  13. * @package OCA\CloudFederationAPI
  14. */
  15. class Config {
  16. public function __construct(
  17. private ICloudFederationProviderManager $cloudFederationProviderManager,
  18. ) {
  19. }
  20. /**
  21. * get a list of supported share types
  22. *
  23. * @param string $resourceType
  24. * @return array
  25. */
  26. public function getSupportedShareTypes($resourceType) {
  27. try {
  28. $provider = $this->cloudFederationProviderManager->getCloudFederationProvider($resourceType);
  29. return $provider->getSupportedShareTypes();
  30. } catch (\Exception $e) {
  31. return [];
  32. }
  33. }
  34. }