aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2024-03-11 12:46:29 -0100
committerGitHub <noreply@github.com>2024-03-11 12:46:29 -0100
commitf4beb95cdc3161a99e048e03ab486e5218d10e0a (patch)
tree3b2a29f1075321b552630e6b7fcefcb1fc4ea55d /lib/public
parent2e30295fd7e6e8dc103388477a50caeb4a9be30d (diff)
parent3fa5e598a8e74cc3c89b3c43a370bfcbef5115c5 (diff)
downloadnextcloud-server-f4beb95cdc3161a99e048e03ab486e5218d10e0a.tar.gz
nextcloud-server-f4beb95cdc3161a99e048e03ab486e5218d10e0a.zip
Merge pull request #42707 from nextcloud/enh/noid/store-file-etag-at-metadata-creation
enh(metadata): store current file etag
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/FilesMetadata/Model/IFilesMetadata.php19
-rw-r--r--lib/public/FilesMetadata/Model/IMetadataValueWrapper.php18
2 files changed, 37 insertions, 0 deletions
diff --git a/lib/public/FilesMetadata/Model/IFilesMetadata.php b/lib/public/FilesMetadata/Model/IFilesMetadata.php
index 7697a2f37ad..024b21039bc 100644
--- a/lib/public/FilesMetadata/Model/IFilesMetadata.php
+++ b/lib/public/FilesMetadata/Model/IFilesMetadata.php
@@ -37,12 +37,14 @@ use OCP\FilesMetadata\Exceptions\FilesMetadataTypeException;
* "mymeta": {
* "value": "this is a test",
* "type": "string",
+ * "etag": "abcd1234",
* "indexed": false,
* "editPermission": 1
* },
* "myapp-anothermeta": {
* "value": 42,
* "type": "int",
+ * "etag": "0987zyxw",
* "indexed": true,
* "editPermission": 0
* }
@@ -113,6 +115,23 @@ interface IFilesMetadata extends JsonSerializable {
public function isIndex(string $key): bool;
/**
+ * returns file etag stored during the last update of the metadata key
+ *
+ * @param string $key metadata key
+ * @return string
+ * @since 29.0.0
+ */
+ public function getEtag(string $key): string;
+
+ /**
+ * set file etag
+ *
+ * @param string $key metadata key
+ * @since 29.0.0
+ */
+ public function setEtag(string $key, string $etag): void;
+
+ /**
* set remote edit permission
* (Webdav PROPPATCH)
*
diff --git a/lib/public/FilesMetadata/Model/IMetadataValueWrapper.php b/lib/public/FilesMetadata/Model/IMetadataValueWrapper.php
index d34cd070c8b..6c551efea81 100644
--- a/lib/public/FilesMetadata/Model/IMetadataValueWrapper.php
+++ b/lib/public/FilesMetadata/Model/IMetadataValueWrapper.php
@@ -286,6 +286,24 @@ interface IMetadataValueWrapper extends JsonSerializable {
public function getValueAny(): mixed;
/**
+ * get stored etag value
+ *
+ * @return string stored etag
+ * @since 29.0.0
+ */
+ public function getEtag(): string;
+
+ /**
+ * set etag value
+ *
+ * @param string $etag etag value
+ *
+ * @return self
+ * @since 29.0.0
+ */
+ public function setEtag(string $etag): self;
+
+ /**
* @param bool $indexed TRUE to set the stored value as an indexed value
*
* @return self