FailDeleteObjectStore.php 980 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace Test\Files\ObjectStore;
  8. use OCP\Files\ObjectStore\IObjectStore;
  9. class FailDeleteObjectStore implements IObjectStore {
  10. private $objectStore;
  11. public function __construct(IObjectStore $objectStore) {
  12. $this->objectStore = $objectStore;
  13. }
  14. public function getStorageId() {
  15. return $this->objectStore->getStorageId();
  16. }
  17. public function readObject($urn) {
  18. return $this->objectStore->readObject($urn);
  19. }
  20. public function writeObject($urn, $stream, ?string $mimetype = null) {
  21. return $this->objectStore->writeObject($urn, $stream, $mimetype);
  22. }
  23. public function deleteObject($urn) {
  24. throw new \Exception();
  25. }
  26. public function objectExists($urn) {
  27. return $this->objectStore->objectExists($urn);
  28. }
  29. public function copyObject($from, $to) {
  30. $this->objectStore->copyObject($from, $to);
  31. }
  32. }