From 065ef14cb025f6664c7a3ed1aa89d333a2944342 Mon Sep 17 00:00:00 2001
From: Morris Jobke <hey@morrisjobke.de>
Date: Thu, 9 Jul 2020 23:39:58 +0200
Subject: [PATCH] Move OC_Mount_Config to proper classname and remove
 OC::$CLASSPATH usage in files_external

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
---
 apps/files_external/appinfo/app.php           |  8 +-
 apps/files_external/appinfo/routes.php        |  2 +-
 apps/files_external/js/settings.js            |  2 +-
 apps/files_external/lib/Command/Verify.php    |  2 +-
 .../lib/Config/ConfigAdapter.php              |  2 +-
 .../lib/Controller/ApiController.php          |  2 +-
 .../lib/Controller/StoragesController.php     |  2 +-
 .../lib/Lib/Backend/LegacyBackend.php         |  2 +-
 .../lib/{config.php => MountConfig.php}       |  6 +-
 .../lib/Service/GlobalStoragesService.php     | 18 ++---
 .../lib/Service/LegacyStoragesService.php     |  8 +-
 .../lib/Service/UserLegacyStoragesService.php |  2 +-
 .../lib/Service/UserStoragesService.php       |  2 +-
 apps/files_external/lib/Settings/Admin.php    |  2 +-
 apps/files_external/lib/Settings/Personal.php |  2 +-
 .../Controller/StoragesControllerTest.php     |  4 +-
 .../Service/GlobalStoragesServiceTest.php     | 74 +++++++++----------
 .../tests/Service/StoragesServiceTest.php     |  8 +-
 .../tests/Service/UserStoragesServiceTest.php | 10 +--
 .../tests/Settings/AdminTest.php              |  2 +-
 lib/private/Encryption/File.php               |  2 +-
 lib/private/Encryption/Util.php               |  2 +-
 lib/private/Log/ExceptionSerializer.php       |  2 +-
 23 files changed, 83 insertions(+), 83 deletions(-)
 rename apps/files_external/lib/{config.php => MountConfig.php} (98%)

diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php
index 8610969535304..96699d4635ebf 100644
--- a/apps/files_external/appinfo/app.php
+++ b/apps/files_external/appinfo/app.php
@@ -30,15 +30,13 @@
 
 use OCA\Files_External\Config\ConfigAdapter;
 
-OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php';
-
 require_once __DIR__ . '/../3rdparty/autoload.php';
 
 // register Application object singleton
-\OC_Mount_Config::$app = \OC::$server->query(\OCA\Files_External\AppInfo\Application::class);
-\OC_Mount_Config::$app->registerListeners();
+\OCA\Files_External\MountConfig::$app = \OC::$server->query(\OCA\Files_External\AppInfo\Application::class);
+\OCA\Files_External\MountConfig::$app->registerListeners();
 
-$appContainer = \OC_Mount_Config::$app->getContainer();
+$appContainer = \OCA\Files_External\MountConfig::$app->getContainer();
 
 \OCA\Files\App::getNavigationManager()->add(function () {
 	$l = \OC::$server->getL10N('files_external');
diff --git a/apps/files_external/appinfo/routes.php b/apps/files_external/appinfo/routes.php
index 743c0b101f877..9085ca9f7db30 100644
--- a/apps/files_external/appinfo/routes.php
+++ b/apps/files_external/appinfo/routes.php
@@ -30,7 +30,7 @@
 /**
  * @var $this \OCP\Route\IRouter
  **/
-\OC_Mount_Config::$app->registerRoutes(
+\OCA\Files_External\MountConfig::$app->registerRoutes(
 	$this,
 	[
 		'resources' => [
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 93a27d5f75dd0..dff352eea3dee 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -171,7 +171,7 @@ var StorageConfig = function(id) {
 	this.id = id;
 	this.backendOptions = {};
 };
-// Keep this in sync with \OC_Mount_Config::STATUS_*
+// Keep this in sync with \OCA\Files_External\MountConfig::STATUS_*
 StorageConfig.Status = {
 	IN_PROGRESS: -1,
 	SUCCESS: 0,
diff --git a/apps/files_external/lib/Command/Verify.php b/apps/files_external/lib/Command/Verify.php
index e5bfb3052eead..dbc6960e969ac 100644
--- a/apps/files_external/lib/Command/Verify.php
+++ b/apps/files_external/lib/Command/Verify.php
@@ -118,7 +118,7 @@ private function updateStorageStatus(StorageConfig &$storage, $configInput, Outp
 			$backend = $storage->getBackend();
 			// update status (can be time-consuming)
 			$storage->setStatus(
-				\OC_Mount_Config::getBackendStatus(
+				\OCA\Files_External\MountConfig::getBackendStatus(
 					$backend->getStorageClass(),
 					$storage->getBackendOptions(),
 					false
diff --git a/apps/files_external/lib/Config/ConfigAdapter.php b/apps/files_external/lib/Config/ConfigAdapter.php
index fa33f3de793fa..24610ec4bf63e 100644
--- a/apps/files_external/lib/Config/ConfigAdapter.php
+++ b/apps/files_external/lib/Config/ConfigAdapter.php
@@ -80,7 +80,7 @@ public function __construct(
 	 */
 	private function prepareStorageConfig(StorageConfig &$storage, IUser $user) {
 		foreach ($storage->getBackendOptions() as $option => $value) {
-			$storage->setBackendOption($option, \OC_Mount_Config::substitutePlaceholdersInConfig($value, $user->getUID()));
+			$storage->setBackendOption($option, \OCA\Files_External\MountConfig::substitutePlaceholdersInConfig($value, $user->getUID()));
 		}
 
 		$objectStore = $storage->getBackendOption('objectstore');
diff --git a/apps/files_external/lib/Controller/ApiController.php b/apps/files_external/lib/Controller/ApiController.php
index 6418e5d73ad5d..de2942e554add 100644
--- a/apps/files_external/lib/Controller/ApiController.php
+++ b/apps/files_external/lib/Controller/ApiController.php
@@ -99,7 +99,7 @@ public function getUserMounts(): DataResponse {
 		$entries = [];
 		$user = $this->userSession->getUser()->getUID();
 
-		$mounts = \OC_Mount_Config::getAbsoluteMountPoints($user);
+		$mounts = \OCA\Files_External\MountConfig::getAbsoluteMountPoints($user);
 		foreach ($mounts as $mountPoint => $mount) {
 			$entries[] = $this->formatMount($mountPoint, $mount);
 		}
diff --git a/apps/files_external/lib/Controller/StoragesController.php b/apps/files_external/lib/Controller/StoragesController.php
index a3a2712520a0f..d92aa9e416984 100644
--- a/apps/files_external/lib/Controller/StoragesController.php
+++ b/apps/files_external/lib/Controller/StoragesController.php
@@ -250,7 +250,7 @@ protected function updateStorageStatus(StorageConfig &$storage, $testOnly = true
 			$backend = $storage->getBackend();
 			// update status (can be time-consuming)
 			$storage->setStatus(
-				\OC_Mount_Config::getBackendStatus(
+				\OCA\Files_External\MountConfig::getBackendStatus(
 					$backend->getStorageClass(),
 					$storage->getBackendOptions(),
 					false,
diff --git a/apps/files_external/lib/Lib/Backend/LegacyBackend.php b/apps/files_external/lib/Lib/Backend/LegacyBackend.php
index 87dabda8bb69e..710f907608af9 100644
--- a/apps/files_external/lib/Lib/Backend/LegacyBackend.php
+++ b/apps/files_external/lib/Lib/Backend/LegacyBackend.php
@@ -29,7 +29,7 @@
 use OCA\Files_External\Lib\MissingDependency;
 
 /**
- * Legacy compatibility for OC_Mount_Config::registerBackend()
+ * Legacy compatibility for OCA\Files_External\MountConfig::registerBackend()
  */
 class LegacyBackend extends Backend {
 	use LegacyDependencyCheckPolyfill {
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/MountConfig.php
similarity index 98%
rename from apps/files_external/lib/config.php
rename to apps/files_external/lib/MountConfig.php
index 745f2da6d5e05..0257123b119f2 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/MountConfig.php
@@ -38,6 +38,8 @@
  *
  */
 
+namespace OCA\Files_External;
+
 use OCA\Files_External\AppInfo\Application;
 use OCA\Files_External\Config\IConfigHandler;
 use OCA\Files_External\Config\UserContext;
@@ -57,7 +59,7 @@
 /**
  * Class to configure mount.json globally and for users
  */
-class OC_Mount_Config {
+class MountConfig {
 	// TODO: make this class non-static and give it a proper namespace
 
 	public const MOUNT_TYPE_GLOBAL = 'global';
@@ -325,7 +327,7 @@ public static function dependencyMessage($backends) {
 			$backends = implode(', ', array_map(function ($backend) {
 				return '"' . $backend->getText() . '"';
 			}, $dependants));
-			$message .= '<p>' . OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends) . '</p>';
+			$message .= '<p>' . MountConfig::getSingleDependencyMessage($l, $module, $backends) . '</p>';
 		}
 
 		return $message;
diff --git a/apps/files_external/lib/Service/GlobalStoragesService.php b/apps/files_external/lib/Service/GlobalStoragesService.php
index 95a7c47665dc4..2905e08883edb 100644
--- a/apps/files_external/lib/Service/GlobalStoragesService.php
+++ b/apps/files_external/lib/Service/GlobalStoragesService.php
@@ -51,7 +51,7 @@ protected function triggerHooks(StorageConfig $storage, $signal) {
 			$this->triggerApplicableHooks(
 				$signal,
 				$storage->getMountPoint(),
-				\OC_Mount_Config::MOUNT_TYPE_USER,
+				\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 				['all']
 			);
 			return;
@@ -60,13 +60,13 @@ protected function triggerHooks(StorageConfig $storage, $signal) {
 		$this->triggerApplicableHooks(
 			$signal,
 			$storage->getMountPoint(),
-			\OC_Mount_Config::MOUNT_TYPE_USER,
+			\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 			$applicableUsers
 		);
 		$this->triggerApplicableHooks(
 			$signal,
 			$storage->getMountPoint(),
-			\OC_Mount_Config::MOUNT_TYPE_GROUP,
+			\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 			$applicableGroups
 		);
 	}
@@ -100,7 +100,7 @@ protected function triggerChangeHooks(StorageConfig $oldStorage, StorageConfig $
 			$this->triggerApplicableHooks(
 				Filesystem::signal_delete_mount,
 				$oldStorage->getMountPoint(),
-				\OC_Mount_Config::MOUNT_TYPE_USER,
+				\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 				['all']
 			);
 		}
@@ -109,7 +109,7 @@ protected function triggerChangeHooks(StorageConfig $oldStorage, StorageConfig $
 		$this->triggerApplicableHooks(
 			Filesystem::signal_delete_mount,
 			$oldStorage->getMountPoint(),
-			\OC_Mount_Config::MOUNT_TYPE_USER,
+			\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 			$userDeletions
 		);
 
@@ -117,7 +117,7 @@ protected function triggerChangeHooks(StorageConfig $oldStorage, StorageConfig $
 		$this->triggerApplicableHooks(
 			Filesystem::signal_delete_mount,
 			$oldStorage->getMountPoint(),
-			\OC_Mount_Config::MOUNT_TYPE_GROUP,
+			\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 			$groupDeletions
 		);
 
@@ -125,7 +125,7 @@ protected function triggerChangeHooks(StorageConfig $oldStorage, StorageConfig $
 		$this->triggerApplicableHooks(
 			Filesystem::signal_create_mount,
 			$newStorage->getMountPoint(),
-			\OC_Mount_Config::MOUNT_TYPE_USER,
+			\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 			$userAdditions
 		);
 
@@ -133,7 +133,7 @@ protected function triggerChangeHooks(StorageConfig $oldStorage, StorageConfig $
 		$this->triggerApplicableHooks(
 			Filesystem::signal_create_mount,
 			$newStorage->getMountPoint(),
-			\OC_Mount_Config::MOUNT_TYPE_GROUP,
+			\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 			$groupAdditions
 		);
 
@@ -145,7 +145,7 @@ protected function triggerChangeHooks(StorageConfig $oldStorage, StorageConfig $
 			$this->triggerApplicableHooks(
 				Filesystem::signal_create_mount,
 				$newStorage->getMountPoint(),
-				\OC_Mount_Config::MOUNT_TYPE_USER,
+				\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 				['all']
 			);
 		}
diff --git a/apps/files_external/lib/Service/LegacyStoragesService.php b/apps/files_external/lib/Service/LegacyStoragesService.php
index fef746a35c081..faaf40ba02868 100644
--- a/apps/files_external/lib/Service/LegacyStoragesService.php
+++ b/apps/files_external/lib/Service/LegacyStoragesService.php
@@ -83,13 +83,13 @@ protected function populateStorageConfigWithLegacyOptions(
 			$storageOptions['priority'] = $backend->getPriority();
 		}
 		$storageConfig->setPriority($storageOptions['priority']);
-		if ($mountType === \OC_Mount_Config::MOUNT_TYPE_USER) {
+		if ($mountType === \OCA\Files_External\MountConfig::MOUNT_TYPE_USER) {
 			$applicableUsers = $storageConfig->getApplicableUsers();
 			if ($applicable !== 'all') {
 				$applicableUsers[] = $applicable;
 				$storageConfig->setApplicableUsers($applicableUsers);
 			}
-		} elseif ($mountType === \OC_Mount_Config::MOUNT_TYPE_GROUP) {
+		} elseif ($mountType === \OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP) {
 			$applicableGroups = $storageConfig->getApplicableGroups();
 			$applicableGroups[] = $applicable;
 			$storageConfig->setApplicableGroups($applicableGroups);
@@ -150,7 +150,7 @@ public function getAllStorages() {
 					$relativeMountPath = rtrim($parts[2], '/');
 					// note: we cannot do this after the loop because the decrypted config
 					// options might be needed for the config hash
-					$storageOptions['options'] = \OC_Mount_Config::decryptPasswords($storageOptions['options']);
+					$storageOptions['options'] = \OCA\Files_External\MountConfig::decryptPasswords($storageOptions['options']);
 					if (!isset($storageOptions['backend'])) {
 						$storageOptions['backend'] = $storageOptions['class']; // legacy compat
 					}
@@ -168,7 +168,7 @@ public function getAllStorages() {
 						// but at this point we don't know the max-id, so use
 						// first group it by config hash
 						$storageOptions['mountpoint'] = $rootMountPath;
-						$configId = \OC_Mount_Config::makeConfigHash($storageOptions);
+						$configId = \OCA\Files_External\MountConfig::makeConfigHash($storageOptions);
 						if (isset($storagesWithConfigHash[$configId])) {
 							$currentStorage = $storagesWithConfigHash[$configId];
 						}
diff --git a/apps/files_external/lib/Service/UserLegacyStoragesService.php b/apps/files_external/lib/Service/UserLegacyStoragesService.php
index 3ffd49863b9ed..ea3794384ba2a 100644
--- a/apps/files_external/lib/Service/UserLegacyStoragesService.php
+++ b/apps/files_external/lib/Service/UserLegacyStoragesService.php
@@ -51,6 +51,6 @@ public function __construct(BackendService $backendService, IUserSession $userSe
 	protected function readLegacyConfig() {
 		// read user config
 		$user = $this->userSession->getUser()->getUID();
-		return \OC_Mount_Config::readData($user);
+		return \OCA\Files_External\MountConfig::readData($user);
 	}
 }
diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php
index 7b793ca819e66..411a1a54dd6ab 100644
--- a/apps/files_external/lib/Service/UserStoragesService.php
+++ b/apps/files_external/lib/Service/UserStoragesService.php
@@ -78,7 +78,7 @@ protected function triggerHooks(StorageConfig $storage, $signal) {
 		$this->triggerApplicableHooks(
 			$signal,
 			$storage->getMountPoint(),
-			\OC_Mount_Config::MOUNT_TYPE_USER,
+			\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 			[$user]
 		);
 	}
diff --git a/apps/files_external/lib/Settings/Admin.php b/apps/files_external/lib/Settings/Admin.php
index d3c2c07aa831d..b0b1615b0ebef 100644
--- a/apps/files_external/lib/Settings/Admin.php
+++ b/apps/files_external/lib/Settings/Admin.php
@@ -66,7 +66,7 @@ public function getForm() {
 			'storages'             => $this->globalStoragesService->getStorages(),
 			'backends'             => $this->backendService->getAvailableBackends(),
 			'authMechanisms'       => $this->backendService->getAuthMechanisms(),
-			'dependencies'         => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()),
+			'dependencies'         => \OCA\Files_External\MountConfig::dependencyMessage($this->backendService->getBackends()),
 			'allowUserMounting'    => $this->backendService->isUserMountingAllowed(),
 			'globalCredentials'    => $this->globalAuth->getAuth(''),
 			'globalCredentialsUid' => '',
diff --git a/apps/files_external/lib/Settings/Personal.php b/apps/files_external/lib/Settings/Personal.php
index de94793a6af8b..b863d4751488b 100644
--- a/apps/files_external/lib/Settings/Personal.php
+++ b/apps/files_external/lib/Settings/Personal.php
@@ -74,7 +74,7 @@ public function getForm() {
 			'storages'             => $this->userGlobalStoragesService->getStorages(),
 			'backends'             => $this->backendService->getAvailableBackends(),
 			'authMechanisms'       => $this->backendService->getAuthMechanisms(),
-			'dependencies'         => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()),
+			'dependencies'         => \OCA\Files_External\MountConfig::dependencyMessage($this->backendService->getBackends()),
 			'allowUserMounting'    => $this->backendService->isUserMountingAllowed(),
 			'globalCredentials'    => $this->globalAuth->getAuth($uid),
 			'globalCredentialsUid' => $uid,
diff --git a/apps/files_external/tests/Controller/StoragesControllerTest.php b/apps/files_external/tests/Controller/StoragesControllerTest.php
index 617ad11c4594b..7572da2575211 100644
--- a/apps/files_external/tests/Controller/StoragesControllerTest.php
+++ b/apps/files_external/tests/Controller/StoragesControllerTest.php
@@ -50,11 +50,11 @@ abstract class StoragesControllerTest extends \Test\TestCase {
 	protected $service;
 
 	protected function setUp(): void {
-		\OC_Mount_Config::$skipTest = true;
+		\OCA\Files_External\MountConfig::$skipTest = true;
 	}
 
 	protected function tearDown(): void {
-		\OC_Mount_Config::$skipTest = false;
+		\OCA\Files_External\MountConfig::$skipTest = false;
 	}
 
 	/**
diff --git a/apps/files_external/tests/Service/GlobalStoragesServiceTest.php b/apps/files_external/tests/Service/GlobalStoragesServiceTest.php
index afbece9241a3d..d08b8079d12ff 100644
--- a/apps/files_external/tests/Service/GlobalStoragesServiceTest.php
+++ b/apps/files_external/tests/Service/GlobalStoragesServiceTest.php
@@ -202,7 +202,7 @@ public function hooksAddStorageDataProvider() {
 				[
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'all'
 					],
 				],
@@ -215,7 +215,7 @@ public function hooksAddStorageDataProvider() {
 				[
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user1',
 					],
 				],
@@ -228,7 +228,7 @@ public function hooksAddStorageDataProvider() {
 				[
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group1',
 					],
 				],
@@ -240,12 +240,12 @@ public function hooksAddStorageDataProvider() {
 				[
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user1',
 					],
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user2',
 					],
 				],
@@ -258,12 +258,12 @@ public function hooksAddStorageDataProvider() {
 				[
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group1'
 					],
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group2'
 					],
 				],
@@ -276,22 +276,22 @@ public function hooksAddStorageDataProvider() {
 				[
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user1',
 					],
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user2',
 					],
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group1'
 					],
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group2'
 					],
 				],
@@ -334,27 +334,27 @@ public function hooksUpdateStorageDataProvider() {
 					// delete the "all entry"
 					[
 						Filesystem::signal_delete_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'all',
 					],
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user1',
 					],
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user2',
 					],
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group1'
 					],
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group2'
 					],
 				],
@@ -369,12 +369,12 @@ public function hooksUpdateStorageDataProvider() {
 				[
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user2',
 					],
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group2'
 					],
 				],
@@ -389,12 +389,12 @@ public function hooksUpdateStorageDataProvider() {
 				[
 					[
 						Filesystem::signal_delete_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user2',
 					],
 					[
 						Filesystem::signal_delete_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group2'
 					],
 				],
@@ -409,18 +409,18 @@ public function hooksUpdateStorageDataProvider() {
 				[
 					[
 						Filesystem::signal_delete_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user1',
 					],
 					[
 						Filesystem::signal_delete_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group1'
 					],
 					// create the "all" entry
 					[
 						Filesystem::signal_create_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'all'
 					],
 				],
@@ -472,7 +472,7 @@ public function testHooksUpdateStorage(
 		}
 	}
 
-	
+
 	public function testHooksRenameMountPoint() {
 		$storage = $this->makeTestStorageData();
 		$storage->setApplicableUsers(['user1', 'user2']);
@@ -491,50 +491,50 @@ public function testHooksRenameMountPoint() {
 			[
 				Filesystem::signal_delete_mount,
 				'/mountpoint',
-				\OC_Mount_Config::MOUNT_TYPE_USER,
+				\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 				'user1',
 			],
 			[
 				Filesystem::signal_delete_mount,
 				'/mountpoint',
-				\OC_Mount_Config::MOUNT_TYPE_USER,
+				\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 				'user2',
 			],
 			[
 				Filesystem::signal_delete_mount,
 				'/mountpoint',
-				\OC_Mount_Config::MOUNT_TYPE_GROUP,
+				\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 				'group1',
 			],
 			[
 				Filesystem::signal_delete_mount,
 				'/mountpoint',
-				\OC_Mount_Config::MOUNT_TYPE_GROUP,
+				\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 				'group2',
 			],
 			// creates new one
 			[
 				Filesystem::signal_create_mount,
 				'/renamedMountpoint',
-				\OC_Mount_Config::MOUNT_TYPE_USER,
+				\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 				'user1',
 			],
 			[
 				Filesystem::signal_create_mount,
 				'/renamedMountpoint',
-				\OC_Mount_Config::MOUNT_TYPE_USER,
+				\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 				'user2',
 			],
 			[
 				Filesystem::signal_create_mount,
 				'/renamedMountpoint',
-				\OC_Mount_Config::MOUNT_TYPE_GROUP,
+				\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 				'group1',
 			],
 			[
 				Filesystem::signal_create_mount,
 				'/renamedMountpoint',
-				\OC_Mount_Config::MOUNT_TYPE_GROUP,
+				\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 				'group2',
 			],
 		];
@@ -561,22 +561,22 @@ public function hooksDeleteStorageDataProvider() {
 				[
 					[
 						Filesystem::signal_delete_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user1',
 					],
 					[
 						Filesystem::signal_delete_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'user2',
 					],
 					[
 						Filesystem::signal_delete_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group1'
 					],
 					[
 						Filesystem::signal_delete_mount,
-						\OC_Mount_Config::MOUNT_TYPE_GROUP,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_GROUP,
 						'group2'
 					],
 				],
@@ -588,7 +588,7 @@ public function hooksDeleteStorageDataProvider() {
 				[
 					[
 						Filesystem::signal_delete_mount,
-						\OC_Mount_Config::MOUNT_TYPE_USER,
+						\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 						'all',
 					],
 				],
diff --git a/apps/files_external/tests/Service/StoragesServiceTest.php b/apps/files_external/tests/Service/StoragesServiceTest.php
index 049c0a2989ecc..76f0a09c14bfc 100644
--- a/apps/files_external/tests/Service/StoragesServiceTest.php
+++ b/apps/files_external/tests/Service/StoragesServiceTest.php
@@ -102,7 +102,7 @@ protected function setUp(): void {
 			'datadirectory',
 			\OC::$SERVERROOT . '/data/'
 		);
-		\OC_Mount_Config::$skipTest = true;
+		\OCA\Files_External\MountConfig::$skipTest = true;
 
 		$this->mountCache = $this->createMock(IUserMountCache::class);
 
@@ -169,15 +169,15 @@ protected function setUp(): void {
 				}
 			});
 
-		\OC_Mount_Config::$app = $this->getMockBuilder('\OCA\Files_External\Appinfo\Application')
+		\OCA\Files_External\MountConfig::$app = $this->getMockBuilder('\OCA\Files_External\Appinfo\Application')
 			->disableOriginalConstructor()
 			->getMock();
-		\OC_Mount_Config::$app->method('getContainer')
+		\OCA\Files_External\MountConfig::$app->method('getContainer')
 			->willReturn($containerMock);
 	}
 
 	protected function tearDown(): void {
-		\OC_Mount_Config::$skipTest = false;
+		\OCA\Files_External\MountConfig::$skipTest = false;
 		self::$hookCalls = [];
 		if ($this->dbConfig) {
 			$this->dbConfig->clean();
diff --git a/apps/files_external/tests/Service/UserStoragesServiceTest.php b/apps/files_external/tests/Service/UserStoragesServiceTest.php
index 7d177f76904a9..9dd4a570c334b 100644
--- a/apps/files_external/tests/Service/UserStoragesServiceTest.php
+++ b/apps/files_external/tests/Service/UserStoragesServiceTest.php
@@ -106,7 +106,7 @@ public function testAddStorage() {
 			current(self::$hookCalls),
 			Filesystem::signal_create_mount,
 			$storage->getMountPoint(),
-			\OC_Mount_Config::MOUNT_TYPE_USER,
+			\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 			$this->userId
 		);
 
@@ -157,7 +157,7 @@ public function testDeleteStorage($backendOptions, $rustyStorageId, $expectedCou
 			self::$hookCalls[1],
 			Filesystem::signal_delete_mount,
 			'/mountpoint',
-			\OC_Mount_Config::MOUNT_TYPE_USER,
+			\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 			$this->userId
 		);
 	}
@@ -178,19 +178,19 @@ public function testHooksRenameMountPoint() {
 			self::$hookCalls[0],
 			Filesystem::signal_delete_mount,
 			'/mountpoint',
-			\OC_Mount_Config::MOUNT_TYPE_USER,
+			\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 			$this->userId
 		);
 		$this->assertHookCall(
 			self::$hookCalls[1],
 			Filesystem::signal_create_mount,
 			'/renamedMountpoint',
-			\OC_Mount_Config::MOUNT_TYPE_USER,
+			\OCA\Files_External\MountConfig::MOUNT_TYPE_USER,
 			$this->userId
 		);
 	}
 
-	
+
 	public function testGetAdminStorage() {
 		$this->expectException(\OCA\Files_External\NotFoundException::class);
 
diff --git a/apps/files_external/tests/Settings/AdminTest.php b/apps/files_external/tests/Settings/AdminTest.php
index 8edca14f3b184..f8d6bce1d62a1 100644
--- a/apps/files_external/tests/Settings/AdminTest.php
+++ b/apps/files_external/tests/Settings/AdminTest.php
@@ -95,7 +95,7 @@ public function testGetForm() {
 			'storages'             => ['a', 'b', 'c'],
 			'backends'             => ['d', 'e', 'f'],
 			'authMechanisms'       => ['g', 'h', 'i'],
-			'dependencies'         => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()),
+			'dependencies'         => \OCA\Files_External\MountConfig::dependencyMessage($this->backendService->getBackends()),
 			'allowUserMounting'    => true,
 			'globalCredentials'    => 'asdf:asdf',
 			'globalCredentialsUid' => '',
diff --git a/lib/private/Encryption/File.php b/lib/private/Encryption/File.php
index 13879c02cdc49..b631e4fc63f56 100644
--- a/lib/private/Encryption/File.php
+++ b/lib/private/Encryption/File.php
@@ -110,7 +110,7 @@ public function getAccessList($path) {
 
 		// check if it is a group mount
 		if (\OCP\App::isEnabled("files_external")) {
-			$mounts = \OC_Mount_Config::getSystemMountPoints();
+			$mounts = \OCA\Files_External\MountConfig::getSystemMountPoints();
 			foreach ($mounts as $mount) {
 				if ($mount['mountpoint'] == substr($ownerPath, 1, strlen($mount['mountpoint']))) {
 					$mountedFor = $this->util->getUserWithAccessToMountPoint($mount['applicable']['users'], $mount['applicable']['groups']);
diff --git a/lib/private/Encryption/Util.php b/lib/private/Encryption/Util.php
index 8b3360c30e0e6..0bda00a5cbc7f 100644
--- a/lib/private/Encryption/Util.php
+++ b/lib/private/Encryption/Util.php
@@ -299,7 +299,7 @@ public function getUserWithAccessToMountPoint($users, $groups) {
 	 */
 	public function isSystemWideMountPoint($path, $uid) {
 		if (\OCP\App::isEnabled("files_external")) {
-			$mounts = \OC_Mount_Config::getSystemMountPoints();
+			$mounts = \OCA\Files_External\MountConfig::getSystemMountPoints();
 			foreach ($mounts as $mount) {
 				if (strpos($path, '/files/' . $mount['mountpoint']) === 0) {
 					if ($this->isMountPointApplicableToUser($mount, $uid)) {
diff --git a/lib/private/Log/ExceptionSerializer.php b/lib/private/Log/ExceptionSerializer.php
index 587d6ff37db15..a2bc1963003f2 100644
--- a/lib/private/Log/ExceptionSerializer.php
+++ b/lib/private/Log/ExceptionSerializer.php
@@ -81,7 +81,7 @@ class ExceptionSerializer {
 		'storeKeyPair',
 		'setupUser',
 
-		// files_external: OC_Mount_Config
+		// files_external: OCA\Files_External\MountConfig
 		'getBackendStatus',
 
 		// files_external: UserStoragesController
