2017-04-26 08:53:11 -04:00
|
|
|
<?php
|
|
|
|
|
/**
|
2024-06-06 03:55:47 -04:00
|
|
|
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2017-04-26 08:53:11 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCA\Files_External\Config;
|
|
|
|
|
|
|
|
|
|
use OC\Files\Mount\MountPoint;
|
2020-10-07 09:31:03 -04:00
|
|
|
use OCA\Files_External\Lib\Auth\Password\SessionCredentials;
|
|
|
|
|
use OCA\Files_External\Lib\StorageConfig;
|
2017-04-26 08:53:11 -04:00
|
|
|
|
|
|
|
|
class ExternalMountPoint extends MountPoint {
|
2020-10-07 09:31:03 -04:00
|
|
|
|
|
|
|
|
/** @var StorageConfig */
|
|
|
|
|
protected $storageConfig;
|
|
|
|
|
|
|
|
|
|
public function __construct(StorageConfig $storageConfig, $storage, $mountpoint, $arguments = null, $loader = null, $mountOptions = null, $mountId = null) {
|
|
|
|
|
$this->storageConfig = $storageConfig;
|
2022-02-02 10:12:57 -05:00
|
|
|
parent::__construct($storage, $mountpoint, $arguments, $loader, $mountOptions, $mountId, ConfigAdapter::class);
|
2020-10-07 09:31:03 -04:00
|
|
|
}
|
|
|
|
|
|
2017-04-26 08:53:11 -04:00
|
|
|
public function getMountType() {
|
2020-10-07 09:31:03 -04:00
|
|
|
return ($this->storageConfig->getAuthMechanism() instanceof SessionCredentials) ? 'external-session' : 'external';
|
2017-04-26 08:53:11 -04:00
|
|
|
}
|
2023-03-31 12:58:59 -04:00
|
|
|
|
|
|
|
|
public function getStorageConfig(): StorageConfig {
|
|
|
|
|
return $this->storageConfig;
|
|
|
|
|
}
|
2017-04-26 08:53:11 -04:00
|
|
|
}
|