From dd510dfe70782fba38d068e9180fe95cf9bf5a5a Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 1 Sep 2022 17:28:18 +0200 Subject: Allow to mesure free space in object storages, based on used size and quota If the object storage backend doesn't return quota or used bytes information, use a config override for the quota and count the size used in Nextcloud instead. Signed-off-by: Thomas Citharel --- lib/private/Files/ObjectStore/StorageObjectStore.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/private/Files/ObjectStore/StorageObjectStore.php') diff --git a/lib/private/Files/ObjectStore/StorageObjectStore.php b/lib/private/Files/ObjectStore/StorageObjectStore.php index 85926be897e..260238c106c 100644 --- a/lib/private/Files/ObjectStore/StorageObjectStore.php +++ b/lib/private/Files/ObjectStore/StorageObjectStore.php @@ -23,6 +23,7 @@ */ namespace OC\Files\ObjectStore; +use OCP\Files\FileInfo; use OCP\Files\ObjectStore\IObjectStore; use OCP\Files\Storage\IStorage; use function is_resource; @@ -91,4 +92,12 @@ class StorageObjectStore implements IObjectStore { public function copyObject($from, $to) { $this->storage->copy($from, $to); } + + public function bytesUsed(): int { + return FileInfo::SPACE_UNKNOWN; + } + + public function bytesQuota(): int { + return FileInfo::SPACE_UNLIMITED; + } } -- cgit v1.2.3