2010-05-08 15:32:20 -04:00
|
|
|
<?php
|
2024-05-23 03:26:56 -04:00
|
|
|
|
2010-05-08 15:32:20 -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
|
2012-09-07 12:30:48 -04:00
|
|
|
*/
|
2024-09-15 09:38:25 -04:00
|
|
|
|
2012-09-07 12:30:48 -04:00
|
|
|
namespace OC\Files\Storage;
|
2020-04-09 05:48:10 -04:00
|
|
|
|
2024-09-19 12:19:34 -04:00
|
|
|
use OCP\Files\Cache\ICache;
|
|
|
|
|
use OCP\Files\Cache\IPropagator;
|
|
|
|
|
use OCP\Files\Cache\IScanner;
|
|
|
|
|
use OCP\Files\Cache\IUpdater;
|
|
|
|
|
use OCP\Files\Cache\IWatcher;
|
2024-09-15 11:14:37 -04:00
|
|
|
use OCP\Files\Storage\ILockingStorage;
|
2024-09-15 09:38:25 -04:00
|
|
|
use OCP\Files\Storage\IStorage;
|
2010-05-08 15:32:20 -04:00
|
|
|
|
|
|
|
|
/**
|
2012-10-20 18:31:32 -04:00
|
|
|
* Provide a common interface to all different storage options
|
2013-03-22 19:10:12 -04:00
|
|
|
*
|
|
|
|
|
* All paths passed to the storage are relative to the storage and should NOT have a leading slash.
|
2010-05-08 15:32:20 -04:00
|
|
|
*/
|
2024-09-15 11:14:37 -04:00
|
|
|
interface Storage extends IStorage, ILockingStorage {
|
2024-10-01 10:12:30 -04:00
|
|
|
public function getCache(string $path = '', ?IStorage $storage = null): ICache;
|
2024-09-15 11:14:37 -04:00
|
|
|
|
2024-10-01 10:12:30 -04:00
|
|
|
public function getScanner(string $path = '', ?IStorage $storage = null): IScanner;
|
2024-09-15 11:14:37 -04:00
|
|
|
|
2024-10-01 10:12:30 -04:00
|
|
|
public function getWatcher(string $path = '', ?IStorage $storage = null): IWatcher;
|
2024-09-15 11:14:37 -04:00
|
|
|
|
2024-10-01 10:12:30 -04:00
|
|
|
public function getPropagator(?IStorage $storage = null): IPropagator;
|
2024-09-15 11:14:37 -04:00
|
|
|
|
2024-10-01 10:12:30 -04:00
|
|
|
public function getUpdater(?IStorage $storage = null): IUpdater;
|
2024-09-15 11:14:37 -04:00
|
|
|
|
2024-09-19 12:19:34 -04:00
|
|
|
public function getStorageCache(): \OC\Files\Cache\Storage;
|
2013-04-25 18:00:18 -04:00
|
|
|
|
2024-10-01 10:12:30 -04:00
|
|
|
public function getMetaData(string $path): ?array;
|
2015-04-20 08:25:39 -04:00
|
|
|
|
2020-03-27 12:47:20 -04:00
|
|
|
/**
|
|
|
|
|
* Get the contents of a directory with metadata
|
|
|
|
|
*
|
|
|
|
|
* The metadata array will contain the following fields
|
|
|
|
|
*
|
|
|
|
|
* - name
|
|
|
|
|
* - mimetype
|
|
|
|
|
* - mtime
|
|
|
|
|
* - size
|
|
|
|
|
* - etag
|
|
|
|
|
* - storage_mtime
|
|
|
|
|
* - permissions
|
|
|
|
|
*/
|
2024-10-01 10:12:30 -04:00
|
|
|
public function getDirectoryContent(string $directory): \Traversable;
|
2010-05-08 15:32:20 -04:00
|
|
|
}
|