2014-06-17 16:06:56 -04:00
|
|
|
<?php
|
2024-05-23 03:26:56 -04:00
|
|
|
|
2015-03-26 06:44:34 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2015-03-26 06:44:34 -04:00
|
|
|
*/
|
2014-06-17 16:06:56 -04:00
|
|
|
namespace OCP\Files\ObjectStore;
|
|
|
|
|
|
2018-11-19 09:34:07 -05:00
|
|
|
use OCP\Files\NotFoundException;
|
|
|
|
|
|
2015-04-16 11:00:08 -04:00
|
|
|
/**
|
|
|
|
|
* Interface IObjectStore
|
|
|
|
|
*
|
|
|
|
|
* @since 7.0.0
|
|
|
|
|
*/
|
2014-06-17 16:06:56 -04:00
|
|
|
interface IObjectStore {
|
2014-06-18 09:20:26 -04:00
|
|
|
/**
|
|
|
|
|
* @return string the container or bucket name where objects are stored
|
2015-04-16 11:00:08 -04:00
|
|
|
* @since 7.0.0
|
2014-06-18 09:20:26 -04:00
|
|
|
*/
|
2017-07-22 15:10:16 -04:00
|
|
|
public function getStorageId();
|
2014-06-18 09:20:26 -04:00
|
|
|
|
2014-06-17 16:06:56 -04:00
|
|
|
/**
|
|
|
|
|
* @param string $urn the unified resource name used to identify the object
|
2014-06-20 06:27:47 -04:00
|
|
|
* @return resource stream with the read data
|
2015-04-16 11:00:08 -04:00
|
|
|
* @throws \Exception when something goes wrong, message will be logged
|
2018-11-19 09:34:07 -05:00
|
|
|
* @throws NotFoundException if file does not exist
|
2015-04-16 11:00:08 -04:00
|
|
|
* @since 7.0.0
|
2014-06-17 16:06:56 -04:00
|
|
|
*/
|
2017-07-22 15:10:16 -04:00
|
|
|
public function readObject($urn);
|
2014-06-18 09:20:26 -04:00
|
|
|
|
2014-06-17 16:06:56 -04:00
|
|
|
/**
|
|
|
|
|
* @param string $urn the unified resource name used to identify the object
|
2014-06-20 06:27:47 -04:00
|
|
|
* @param resource $stream stream with the data to write
|
2021-04-15 11:14:57 -04:00
|
|
|
* @param string|null $mimetype the mimetype to set for the remove object @since 22.0.0
|
2015-04-16 11:00:08 -04:00
|
|
|
* @throws \Exception when something goes wrong, message will be logged
|
|
|
|
|
* @since 7.0.0
|
2014-06-17 16:06:56 -04:00
|
|
|
*/
|
2024-03-28 11:13:19 -04:00
|
|
|
public function writeObject($urn, $stream, ?string $mimetype = null);
|
2014-06-17 16:06:56 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string $urn the unified resource name used to identify the object
|
|
|
|
|
* @return void
|
2015-04-16 11:00:08 -04:00
|
|
|
* @throws \Exception when something goes wrong, message will be logged
|
|
|
|
|
* @since 7.0.0
|
2014-06-17 16:06:56 -04:00
|
|
|
*/
|
2017-07-22 15:10:16 -04:00
|
|
|
public function deleteObject($urn);
|
2018-12-10 11:20:45 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Check if an object exists in the object store
|
|
|
|
|
*
|
|
|
|
|
* @param string $urn
|
|
|
|
|
* @return bool
|
|
|
|
|
* @since 16.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function objectExists($urn);
|
2020-11-05 10:30:05 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param string $from the unified resource name used to identify the source object
|
|
|
|
|
* @param string $to the unified resource name used to identify the target object
|
|
|
|
|
* @return void
|
|
|
|
|
* @since 21.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function copyObject($from, $to);
|
2025-08-15 08:04:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get pre signed url for an object
|
|
|
|
|
* @since 33.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function preSignedUrl(string $urn, \DateTimeInterface $expiration): ?string;
|
2015-04-16 11:00:08 -04:00
|
|
|
}
|