mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
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>
47 lines
1 KiB
PHP
47 lines
1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/**
|
|
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace Test\Files\ObjectStore;
|
|
|
|
use OCP\Files\ObjectStore\IObjectStore;
|
|
|
|
class FailWriteObjectStore 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) {
|
|
// emulate a failed write that didn't throw an error
|
|
return true;
|
|
}
|
|
|
|
public function deleteObject($urn) {
|
|
$this->objectStore->deleteObject($urn);
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|