Storage.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OC\Files\Storage;
  8. use OCP\Files\Cache\ICache;
  9. use OCP\Files\Cache\IPropagator;
  10. use OCP\Files\Cache\IScanner;
  11. use OCP\Files\Cache\IUpdater;
  12. use OCP\Files\Cache\IWatcher;
  13. use OCP\Files\Storage\ILockingStorage;
  14. use OCP\Files\Storage\IStorage;
  15. /**
  16. * Provide a common interface to all different storage options
  17. *
  18. * All paths passed to the storage are relative to the storage and should NOT have a leading slash.
  19. */
  20. interface Storage extends IStorage, ILockingStorage {
  21. public function getCache(string $path = '', ?IStorage $storage = null): ICache;
  22. public function getScanner(string $path = '', ?IStorage $storage = null): IScanner;
  23. public function getWatcher(string $path = '', ?IStorage $storage = null): IWatcher;
  24. public function getPropagator(?IStorage $storage = null): IPropagator;
  25. public function getUpdater(?IStorage $storage = null): IUpdater;
  26. public function getStorageCache(): \OC\Files\Cache\Storage;
  27. public function getMetaData(string $path): ?array;
  28. /**
  29. * Get the contents of a directory with metadata
  30. *
  31. * The metadata array will contain the following fields
  32. *
  33. * - name
  34. * - mimetype
  35. * - mtime
  36. * - size
  37. * - etag
  38. * - storage_mtime
  39. * - permissions
  40. */
  41. public function getDirectoryContent(string $directory): \Traversable;
  42. }