1
0

ExternalMountPoint.php 902 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\Files_External\Config;
  7. use OC\Files\Mount\MountPoint;
  8. use OCA\Files_External\Lib\Auth\Password\SessionCredentials;
  9. use OCA\Files_External\Lib\StorageConfig;
  10. class ExternalMountPoint extends MountPoint {
  11. public function __construct(
  12. protected StorageConfig $storageConfig,
  13. $storage,
  14. $mountpoint,
  15. $arguments = null,
  16. $loader = null,
  17. $mountOptions = null,
  18. $mountId = null,
  19. ) {
  20. parent::__construct($storage, $mountpoint, $arguments, $loader, $mountOptions, $mountId, ConfigAdapter::class);
  21. }
  22. public function getMountType() {
  23. return ($this->storageConfig->getAuthMechanism() instanceof SessionCredentials) ? 'external-session' : 'external';
  24. }
  25. public function getStorageConfig(): StorageConfig {
  26. return $this->storageConfig;
  27. }
  28. }