IMountProviderCollection.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 OCP\Files\Config;
  8. use OCP\IUser;
  9. /**
  10. * Manages the different mount providers
  11. * @since 8.0.0
  12. */
  13. interface IMountProviderCollection {
  14. /**
  15. * Get all configured mount points for the user
  16. *
  17. * @param \OCP\IUser $user
  18. * @return \OCP\Files\Mount\IMountPoint[]
  19. * @since 8.0.0
  20. */
  21. public function getMountsForUser(IUser $user);
  22. /**
  23. * Get the configured mount points for the user from a specific mount provider
  24. *
  25. * @param \OCP\IUser $user
  26. * @param class-string<IMountProvider>[] $mountProviderClasses
  27. * @return \OCP\Files\Mount\IMountPoint[]
  28. * @since 24.0.0
  29. */
  30. public function getUserMountsForProviderClasses(IUser $user, array $mountProviderClasses): array;
  31. /**
  32. * Get the configured home mount for this user
  33. *
  34. * @param \OCP\IUser $user
  35. * @return \OCP\Files\Mount\IMountPoint
  36. * @since 9.1.0
  37. */
  38. public function getHomeMountForUser(IUser $user);
  39. /**
  40. * Add a provider for mount points
  41. *
  42. * @param \OCP\Files\Config\IMountProvider $provider
  43. * @since 8.0.0
  44. */
  45. public function registerProvider(IMountProvider $provider);
  46. /**
  47. * Add a filter for mounts
  48. *
  49. * @param callable $filter (IMountPoint $mountPoint, IUser $user) => boolean
  50. * @since 14.0.0
  51. */
  52. public function registerMountFilter(callable $filter);
  53. /**
  54. * Add a provider for home mount points
  55. *
  56. * @param \OCP\Files\Config\IHomeMountProvider $provider
  57. * @since 9.1.0
  58. */
  59. public function registerHomeProvider(IHomeMountProvider $provider);
  60. /**
  61. * Get the mount cache which can be used to search for mounts without setting up the filesystem
  62. *
  63. * @return IUserMountCache
  64. * @since 9.0.0
  65. */
  66. public function getMountCache();
  67. /**
  68. * Get all root mountpoints
  69. *
  70. * @return \OCP\Files\Mount\IMountPoint[]
  71. * @since 20.0.0
  72. */
  73. public function getRootMounts(): array;
  74. }