nextcloud/tests/lib/Files/ObjectStore/FailDeleteObjectStore.php
Carl Schwan b6313f68d3
perf(s3): Expose pre-signed urls for S3
This is faster than going back to nextcloud to download the files.

This is an opt-in setting that can be enabled by setting
use_presigned_url in the object store config.

Additionally add support for the proxy config which is needed in a
docker setup. See https://github.com/juliusknorr/nextcloud-docker-dev/pull/431

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-12-09 11:21:35 +01:00

46 lines
1 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace Test\Files\ObjectStore;
use OCP\Files\ObjectStore\IObjectStore;
class FailDeleteObjectStore implements IObjectStore {
public function __construct(
private IObjectStore $objectStore,
) {
}
public function getStorageId() {
return $this->objectStore->getStorageId();
}
public function readObject($urn) {
return $this->objectStore->readObject($urn);
}
public function writeObject($urn, $stream, ?string $mimetype = null) {
return $this->objectStore->writeObject($urn, $stream, $mimetype);
}
public function deleteObject($urn) {
throw new \Exception();
}
public function objectExists($urn) {
return $this->objectStore->objectExists($urn);
}
public function copyObject($from, $to) {
$this->objectStore->copyObject($from, $to);
}
public function preSignedUrl(string $urn, \DateTimeInterface $expiration): ?string {
return null;
}
}