aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Lib/Storage/SystemBridge.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/lib/Lib/Storage/SystemBridge.php')
-rw-r--r--apps/files_external/lib/Lib/Storage/SystemBridge.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Storage/SystemBridge.php b/apps/files_external/lib/Lib/Storage/SystemBridge.php
new file mode 100644
index 00000000000..80449b2744b
--- /dev/null
+++ b/apps/files_external/lib/Lib/Storage/SystemBridge.php
@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+/**
+ * SPDX-FileCopyrightText: 2024 Robin Appelman <robin@icewind.nl>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCA\Files_External\Lib\Storage;
+
+use Icewind\SMB\System;
+use OCP\IBinaryFinder;
+
+/**
+ * Bridge the NC and SMB binary finding logic
+ */
+class SystemBridge extends System {
+ public function __construct(
+ private IBinaryFinder $binaryFinder,
+ ) {
+ }
+
+ protected function getBinaryPath(string $binary): ?string {
+ $path = $this->binaryFinder->findBinaryPath($binary);
+ return $path !== false ? $path : null;
+ }
+}