diff options
author | Louis Chemineau <louis@chmn.me> | 2023-11-08 12:35:01 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2023-11-08 16:23:53 +0100 |
commit | d3a313f192c090d026bac1fd1a8aed718d54c634 (patch) | |
tree | a4860e713479eb045fcb66fb19161f52a44110d8 /lib/private/FilesMetadata/Model | |
parent | 9285fe04ff277088bc06eda264712d3a164539a9 (diff) | |
download | nextcloud-server-d3a313f192c090d026bac1fd1a8aed718d54c634.tar.gz nextcloud-server-d3a313f192c090d026bac1fd1a8aed718d54c634.zip |
Support getting and setting metadata in DAV requests
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'lib/private/FilesMetadata/Model')
-rw-r--r-- | lib/private/FilesMetadata/Model/FilesMetadata.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/FilesMetadata/Model/FilesMetadata.php b/lib/private/FilesMetadata/Model/FilesMetadata.php index a94c7a9b6ff..b10de55579c 100644 --- a/lib/private/FilesMetadata/Model/FilesMetadata.php +++ b/lib/private/FilesMetadata/Model/FilesMetadata.php @@ -133,7 +133,7 @@ class FilesMetadata implements IFilesMetadata { * @throws FilesMetadataTypeException * @since 28.0.0 */ - public function get(string $key): string { + public function getString(string $key): string { if (!array_key_exists($key, $this->metadata)) { throw new FilesMetadataNotFoundException(); } @@ -276,10 +276,10 @@ class FilesMetadata implements IFilesMetadata { * @throws FilesMetadataKeyFormatException * @since 28.0.0 */ - public function set(string $key, string $value, bool $index = false): IFilesMetadata { + public function setString(string $key, string $value, bool $index = false): IFilesMetadata { $this->confirmKeyFormat($key); try { - if ($this->get($key) === $value && $index === $this->isIndex($key)) { + if ($this->getString($key) === $value && $index === $this->isIndex($key)) { return $this; // we ignore if value and index have not changed } } catch (FilesMetadataNotFoundException|FilesMetadataTypeException $e) { @@ -506,7 +506,7 @@ class FilesMetadata implements IFilesMetadata { return; } - throw new FilesMetadataKeyFormatException('key can only contains alphanumerical characters, and dash (-)'); + throw new FilesMetadataKeyFormatException('key can only contains alphanumerical characters, and dash (-, _)'); } /** |