From 8d1a3daa3fd7d1a4ecb7934662a76266a02ce225 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 3 Aug 2023 23:09:17 +0200 Subject: Allow ext storage Local to go unavailable Whenever an external storage of type Local points at a non-existing directory, process this as a StorageNotAvailable instead of returning 404. This makes desktop clients ignore the folder instead of deleting it when it becomes unavailable. The code change was limited to external storages to avoid issues during setup and with the default home storage. Signed-off-by: Vincent Petry --- apps/files_external/lib/Lib/Backend/Local.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'apps/files_external') diff --git a/apps/files_external/lib/Lib/Backend/Local.php b/apps/files_external/lib/Lib/Backend/Local.php index 88b251360d6..bd15cb46127 100644 --- a/apps/files_external/lib/Lib/Backend/Local.php +++ b/apps/files_external/lib/Lib/Backend/Local.php @@ -26,8 +26,10 @@ namespace OCA\Files_External\Lib\Backend; use OCA\Files_External\Lib\Auth\AuthMechanism; use OCA\Files_External\Lib\Auth\NullMechanism; use OCA\Files_External\Lib\DefinitionParameter; +use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\Service\BackendService; use OCP\IL10N; +use OCP\IUser; class Local extends Backend { public function __construct(IL10N $l, NullMechanism $legacyAuth) { @@ -45,4 +47,8 @@ class Local extends Backend { ->setLegacyAuthMechanism($legacyAuth) ; } + + public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null): void { + $storage->setBackendOption('isExternal', true); + } } -- cgit v1.2.3