aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Files
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/Files')
-rw-r--r--lib/public/Files/Config/Event/UserMountAddedEvent.php26
-rw-r--r--lib/public/Files/Config/Event/UserMountRemovedEvent.php26
-rw-r--r--lib/public/Files/Config/Event/UserMountUpdatedEvent.php27
-rw-r--r--lib/public/Files/Config/ICachedMountFileInfo.php1
-rw-r--r--lib/public/Files/DavUtil.php1
-rw-r--r--lib/public/Files/EmptyFileNameException.php1
-rw-r--r--lib/public/Files/Folder.php11
-rw-r--r--lib/public/Files/GenericFileException.php1
-rw-r--r--lib/public/Files/IAppData.php1
-rw-r--r--lib/public/Files/IFilenameValidator.php2
-rw-r--r--lib/public/Files/InvalidDirectoryException.php1
-rw-r--r--lib/public/Files/Notify/IChange.php1
-rw-r--r--lib/public/Files/Notify/INotifyHandler.php1
-rw-r--r--lib/public/Files/Notify/IRenameChange.php1
-rw-r--r--lib/public/Files/Search/ISearchBinaryOperator.php1
-rw-r--r--lib/public/Files/Search/ISearchComparison.php3
-rw-r--r--lib/public/Files/Search/ISearchOperator.php1
-rw-r--r--lib/public/Files/Search/ISearchOrder.php1
-rw-r--r--lib/public/Files/Search/ISearchQuery.php1
-rw-r--r--lib/public/Files/SimpleFS/ISimpleFile.php1
-rw-r--r--lib/public/Files/SimpleFS/ISimpleFolder.php1
-rw-r--r--lib/public/Files/SimpleFS/ISimpleRoot.php1
-rw-r--r--lib/public/Files/Storage/IChunkedFileWrite.php1
-rw-r--r--lib/public/Files/Storage/IDisableEncryptionStorage.php1
-rw-r--r--lib/public/Files/Storage/INotifyStorage.php1
-rw-r--r--lib/public/Files/Template/BeforeGetTemplatesEvent.php14
-rw-r--r--lib/public/Files/Template/ITemplateManager.php9
-rw-r--r--lib/public/Files/Template/RegisterTemplateCreatorEvent.php1
28 files changed, 135 insertions, 3 deletions
diff --git a/lib/public/Files/Config/Event/UserMountAddedEvent.php b/lib/public/Files/Config/Event/UserMountAddedEvent.php
new file mode 100644
index 00000000000..8abd7512188
--- /dev/null
+++ b/lib/public/Files/Config/Event/UserMountAddedEvent.php
@@ -0,0 +1,26 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\Files\Config\Event;
+
+use OCP\EventDispatcher\Event;
+use OCP\Files\Config\ICachedMountInfo;
+
+/**
+ * Event emitted when a user mount was added.
+ *
+ * @since 32.0.0
+ */
+class UserMountAddedEvent extends Event {
+ public function __construct(
+ public readonly ICachedMountInfo $mountPoint,
+ ) {
+ parent::__construct();
+ }
+}
diff --git a/lib/public/Files/Config/Event/UserMountRemovedEvent.php b/lib/public/Files/Config/Event/UserMountRemovedEvent.php
new file mode 100644
index 00000000000..0de7cfc4a99
--- /dev/null
+++ b/lib/public/Files/Config/Event/UserMountRemovedEvent.php
@@ -0,0 +1,26 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\Files\Config\Event;
+
+use OCP\EventDispatcher\Event;
+use OCP\Files\Config\ICachedMountInfo;
+
+/**
+ * Event emitted when a user mount was removed.
+ *
+ * @since 32.0.0
+ */
+class UserMountRemovedEvent extends Event {
+ public function __construct(
+ public readonly ICachedMountInfo $mountPoint,
+ ) {
+ parent::__construct();
+ }
+}
diff --git a/lib/public/Files/Config/Event/UserMountUpdatedEvent.php b/lib/public/Files/Config/Event/UserMountUpdatedEvent.php
new file mode 100644
index 00000000000..f797bef134e
--- /dev/null
+++ b/lib/public/Files/Config/Event/UserMountUpdatedEvent.php
@@ -0,0 +1,27 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\Files\Config\Event;
+
+use OCP\EventDispatcher\Event;
+use OCP\Files\Config\ICachedMountInfo;
+
+/**
+ * Event emitted when a user mount was moved.
+ *
+ * @since 32.0.0
+ */
+class UserMountUpdatedEvent extends Event {
+ public function __construct(
+ public readonly ICachedMountInfo $oldMountPoint,
+ public readonly ICachedMountInfo $newMountPoint,
+ ) {
+ parent::__construct();
+ }
+}
diff --git a/lib/public/Files/Config/ICachedMountFileInfo.php b/lib/public/Files/Config/ICachedMountFileInfo.php
index 7b331059645..a9b30d8ba6d 100644
--- a/lib/public/Files/Config/ICachedMountFileInfo.php
+++ b/lib/public/Files/Config/ICachedMountFileInfo.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/DavUtil.php b/lib/public/Files/DavUtil.php
index 40d17c77c88..6dde3179bb8 100644
--- a/lib/public/Files/DavUtil.php
+++ b/lib/public/Files/DavUtil.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only
diff --git a/lib/public/Files/EmptyFileNameException.php b/lib/public/Files/EmptyFileNameException.php
index ec13a9fc2be..1630ce63ea2 100644
--- a/lib/public/Files/EmptyFileNameException.php
+++ b/lib/public/Files/EmptyFileNameException.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Folder.php b/lib/public/Files/Folder.php
index 3128a17c10c..a35d2d78bc9 100644
--- a/lib/public/Files/Folder.php
+++ b/lib/public/Files/Folder.php
@@ -199,4 +199,15 @@ interface Folder extends Node {
* @since 9.1.0
*/
public function getRecent($limit, $offset = 0);
+
+ /**
+ * Verify if the given path is valid and allowed from this folder.
+ *
+ * @param string $path the path from this folder
+ * @param string $fileName
+ * @param bool $readonly Check only if the path is allowed for read-only access
+ * @throws InvalidPathException
+ * @since 32.0.0
+ */
+ public function verifyPath($fileName, $readonly = false): void;
}
diff --git a/lib/public/Files/GenericFileException.php b/lib/public/Files/GenericFileException.php
index 288d668e3e7..66a3b5e5ac4 100644
--- a/lib/public/Files/GenericFileException.php
+++ b/lib/public/Files/GenericFileException.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/IAppData.php b/lib/public/Files/IAppData.php
index e5a5c2b7143..4d0c4da6a8a 100644
--- a/lib/public/Files/IAppData.php
+++ b/lib/public/Files/IAppData.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/IFilenameValidator.php b/lib/public/Files/IFilenameValidator.php
index d8bd06d179d..9b7fa1e2e2e 100644
--- a/lib/public/Files/IFilenameValidator.php
+++ b/lib/public/Files/IFilenameValidator.php
@@ -43,7 +43,7 @@ interface IFilenameValidator {
* If no sanitizing is needed the same name is returned.
*
* @param string $name The filename to sanitize
- * @param null|string $charReplacement Character to use for replacing forbidden ones - by default space, dash or underscore is used if allowed.
+ * @param null|string $charReplacement Character to use for replacing forbidden ones - by default underscore, dash or space is used if allowed.
* @throws \InvalidArgumentException if no character replacement was given (and the default could not be applied) or the replacement is not valid.
* @since 32.0.0
*/
diff --git a/lib/public/Files/InvalidDirectoryException.php b/lib/public/Files/InvalidDirectoryException.php
index 7f87eed1a17..b9640209cbf 100644
--- a/lib/public/Files/InvalidDirectoryException.php
+++ b/lib/public/Files/InvalidDirectoryException.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Notify/IChange.php b/lib/public/Files/Notify/IChange.php
index 8f252411a5a..c7c758eec11 100644
--- a/lib/public/Files/Notify/IChange.php
+++ b/lib/public/Files/Notify/IChange.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Notify/INotifyHandler.php b/lib/public/Files/Notify/INotifyHandler.php
index 8777779ca4a..09b3dbca919 100644
--- a/lib/public/Files/Notify/INotifyHandler.php
+++ b/lib/public/Files/Notify/INotifyHandler.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Notify/IRenameChange.php b/lib/public/Files/Notify/IRenameChange.php
index 3e1ae7ed447..b1bfae5fc00 100644
--- a/lib/public/Files/Notify/IRenameChange.php
+++ b/lib/public/Files/Notify/IRenameChange.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Search/ISearchBinaryOperator.php b/lib/public/Files/Search/ISearchBinaryOperator.php
index 661be44596d..fa7ef4d1bb3 100644
--- a/lib/public/Files/Search/ISearchBinaryOperator.php
+++ b/lib/public/Files/Search/ISearchBinaryOperator.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Search/ISearchComparison.php b/lib/public/Files/Search/ISearchComparison.php
index 01b69f5d24c..ab298fa0a57 100644
--- a/lib/public/Files/Search/ISearchComparison.php
+++ b/lib/public/Files/Search/ISearchComparison.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -51,7 +52,7 @@ interface ISearchComparison extends ISearchOperator {
* @since 28.0.0
*/
public const COMPARE_DEFINED = 'is-defined';
-
+
/**
* @since 29.0.0
*/
diff --git a/lib/public/Files/Search/ISearchOperator.php b/lib/public/Files/Search/ISearchOperator.php
index a604bd96b9d..f6ae8edcbb1 100644
--- a/lib/public/Files/Search/ISearchOperator.php
+++ b/lib/public/Files/Search/ISearchOperator.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Search/ISearchOrder.php b/lib/public/Files/Search/ISearchOrder.php
index 23f71e2133e..e6e68849443 100644
--- a/lib/public/Files/Search/ISearchOrder.php
+++ b/lib/public/Files/Search/ISearchOrder.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Search/ISearchQuery.php b/lib/public/Files/Search/ISearchQuery.php
index 109998aee65..1b400c56e5b 100644
--- a/lib/public/Files/Search/ISearchQuery.php
+++ b/lib/public/Files/Search/ISearchQuery.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/SimpleFS/ISimpleFile.php b/lib/public/Files/SimpleFS/ISimpleFile.php
index 10cdc0a919d..4e77299ab00 100644
--- a/lib/public/Files/SimpleFS/ISimpleFile.php
+++ b/lib/public/Files/SimpleFS/ISimpleFile.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/SimpleFS/ISimpleFolder.php b/lib/public/Files/SimpleFS/ISimpleFolder.php
index 79b9fca1dac..95efc676688 100644
--- a/lib/public/Files/SimpleFS/ISimpleFolder.php
+++ b/lib/public/Files/SimpleFS/ISimpleFolder.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/SimpleFS/ISimpleRoot.php b/lib/public/Files/SimpleFS/ISimpleRoot.php
index 5c01c6a2a2e..6be8a1d47c9 100644
--- a/lib/public/Files/SimpleFS/ISimpleRoot.php
+++ b/lib/public/Files/SimpleFS/ISimpleRoot.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Storage/IChunkedFileWrite.php b/lib/public/Files/Storage/IChunkedFileWrite.php
index e166a7f3b1f..0cf27814f0e 100644
--- a/lib/public/Files/Storage/IChunkedFileWrite.php
+++ b/lib/public/Files/Storage/IChunkedFileWrite.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Storage/IDisableEncryptionStorage.php b/lib/public/Files/Storage/IDisableEncryptionStorage.php
index 98a4b4897da..19951da2015 100644
--- a/lib/public/Files/Storage/IDisableEncryptionStorage.php
+++ b/lib/public/Files/Storage/IDisableEncryptionStorage.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Storage/INotifyStorage.php b/lib/public/Files/Storage/INotifyStorage.php
index 0e5cf53af21..063ff815581 100644
--- a/lib/public/Files/Storage/INotifyStorage.php
+++ b/lib/public/Files/Storage/INotifyStorage.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
diff --git a/lib/public/Files/Template/BeforeGetTemplatesEvent.php b/lib/public/Files/Template/BeforeGetTemplatesEvent.php
index 006163c5f7f..9fb7453a50c 100644
--- a/lib/public/Files/Template/BeforeGetTemplatesEvent.php
+++ b/lib/public/Files/Template/BeforeGetTemplatesEvent.php
@@ -17,16 +17,19 @@ use OCP\EventDispatcher\Event;
class BeforeGetTemplatesEvent extends Event {
/** @var array<Template> */
private array $templates;
+ /** @var bool */
+ private bool $withFields;
/**
* @param array<Template> $templates
*
* @since 30.0.0
*/
- public function __construct(array $templates) {
+ public function __construct(array $templates, bool $withFields = false) {
parent::__construct();
$this->templates = $templates;
+ $this->withFields = $withFields;
}
/**
@@ -37,4 +40,13 @@ class BeforeGetTemplatesEvent extends Event {
public function getTemplates(): array {
return $this->templates;
}
+
+ /**
+ * @return bool
+ *
+ * @since 32.0.0
+ */
+ public function shouldGetFields(): bool {
+ return $this->withFields;
+ }
}
diff --git a/lib/public/Files/Template/ITemplateManager.php b/lib/public/Files/Template/ITemplateManager.php
index 9a81aa51ceb..df81bc5604e 100644
--- a/lib/public/Files/Template/ITemplateManager.php
+++ b/lib/public/Files/Template/ITemplateManager.php
@@ -39,6 +39,15 @@ interface ITemplateManager {
public function listTemplates(): array;
/**
+ * Get the fields for a given template
+ *
+ * @param int $fileId
+ * @return array
+ * @since 32.0.0
+ */
+ public function listTemplateFields(int $fileId): array;
+
+ /**
* @return bool
* @since 21.0.0
*/
diff --git a/lib/public/Files/Template/RegisterTemplateCreatorEvent.php b/lib/public/Files/Template/RegisterTemplateCreatorEvent.php
index c931f3e2a78..a9e7fa01252 100644
--- a/lib/public/Files/Template/RegisterTemplateCreatorEvent.php
+++ b/lib/public/Files/Template/RegisterTemplateCreatorEvent.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later