ExternalMountPoint.php 970 B

1234567891011121314151617181920212223242526272829
  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. /** @var StorageConfig */
  12. protected $storageConfig;
  13. public function __construct(StorageConfig $storageConfig, $storage, $mountpoint, $arguments = null, $loader = null, $mountOptions = null, $mountId = null) {
  14. $this->storageConfig = $storageConfig;
  15. parent::__construct($storage, $mountpoint, $arguments, $loader, $mountOptions, $mountId, ConfigAdapter::class);
  16. }
  17. public function getMountType() {
  18. return ($this->storageConfig->getAuthMechanism() instanceof SessionCredentials) ? 'external-session' : 'external';
  19. }
  20. public function getStorageConfig(): StorageConfig {
  21. return $this->storageConfig;
  22. }
  23. }