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-16 07:04:15 -04:00
|
|
|
use OC\Files\Cache\Cache;
|
|
|
|
|
use OC\Files\Cache\Propagator;
|
|
|
|
|
use OC\Files\Cache\Scanner;
|
|
|
|
|
use OC\Files\Cache\Updater;
|
|
|
|
|
use OC\Files\Cache\Watcher;
|
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-09-16 07:04:15 -04:00
|
|
|
* @inheritDoc
|
|
|
|
|
* @return Cache
|
2024-09-15 11:14:37 -04:00
|
|
|
*/
|
|
|
|
|
public function getCache($path = '', $storage = null);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-09-16 07:04:15 -04:00
|
|
|
* @inheritDoc
|
|
|
|
|
* @return Scanner
|
2024-09-15 11:14:37 -04:00
|
|
|
*/
|
|
|
|
|
public function getScanner($path = '', $storage = null);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-09-16 07:04:15 -04:00
|
|
|
* @inheritDoc
|
|
|
|
|
* @return Watcher
|
2024-09-15 11:14:37 -04:00
|
|
|
*/
|
|
|
|
|
public function getWatcher($path = '', $storage = null);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-09-16 07:04:15 -04:00
|
|
|
* @inheritDoc
|
|
|
|
|
* @return Propagator
|
2024-09-15 11:14:37 -04:00
|
|
|
*/
|
|
|
|
|
public function getPropagator($storage = null);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-09-16 07:04:15 -04:00
|
|
|
* @inheritDoc
|
|
|
|
|
* @return Updater
|
2024-09-15 11:14:37 -04:00
|
|
|
*/
|
|
|
|
|
public function getUpdater($storage = null);
|
|
|
|
|
|
2013-04-25 18:00:18 -04:00
|
|
|
/**
|
|
|
|
|
* @return \OC\Files\Cache\Storage
|
|
|
|
|
*/
|
|
|
|
|
public function getStorageCache();
|
|
|
|
|
|
2015-04-20 08:25:39 -04:00
|
|
|
/**
|
2015-04-20 08:54:54 -04:00
|
|
|
* @param string $path
|
2021-02-15 11:52:11 -05:00
|
|
|
* @return array|null
|
2015-04-20 08:25:39 -04:00
|
|
|
*/
|
2015-04-20 08:54:54 -04:00
|
|
|
public function getMetaData($path);
|
2015-04-20 08:25:39 -04:00
|
|
|
|
2020-03-27 12:47:20 -04:00
|
|
|
/**
|
|
|
|
|
* Get the contents of a directory with metadata
|
|
|
|
|
*
|
|
|
|
|
* @param string $directory
|
|
|
|
|
* @return \Traversable an iterator, containing file metadata
|
|
|
|
|
*
|
|
|
|
|
* The metadata array will contain the following fields
|
|
|
|
|
*
|
|
|
|
|
* - name
|
|
|
|
|
* - mimetype
|
|
|
|
|
* - mtime
|
|
|
|
|
* - size
|
|
|
|
|
* - etag
|
|
|
|
|
* - storage_mtime
|
|
|
|
|
* - permissions
|
|
|
|
|
*/
|
|
|
|
|
public function getDirectoryContent($directory): \Traversable;
|
2010-05-08 15:32:20 -04:00
|
|
|
}
|