You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
2.3 KiB

3 years ago
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Morris Jobke <hey@morrisjobke.de>
  7. * @author Robin Appelman <robin@icewind.nl>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. *
  10. * @license AGPL-3.0
  11. *
  12. * This code is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License, version 3,
  14. * as published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License, version 3,
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>
  23. *
  24. */
  25. namespace OCP\Files\Mount;
  26. /**
  27. * Interface IMountManager
  28. *
  29. * Manages all mounted storages in the system
  30. * @since 8.2.0
  31. */
  32. interface IMountManager {
  33. /**
  34. * Add a new mount
  35. *
  36. * @param \OCP\Files\Mount\IMountPoint $mount
  37. * @since 8.2.0
  38. */
  39. public function addMount(IMountPoint $mount);
  40. /**
  41. * Remove a mount
  42. *
  43. * @param string $mountPoint
  44. * @since 8.2.0
  45. */
  46. public function removeMount(string $mountPoint);
  47. /**
  48. * Change the location of a mount
  49. *
  50. * @param string $mountPoint
  51. * @param string $target
  52. * @since 8.2.0
  53. */
  54. public function moveMount(string $mountPoint, string $target);
  55. /**
  56. * Find the mount for $path
  57. *
  58. * @param string $path
  59. * @return \OCP\Files\Mount\IMountPoint|null
  60. * @since 8.2.0
  61. */
  62. public function find(string $path);
  63. /**
  64. * Find all mounts in $path
  65. *
  66. * @param string $path
  67. * @return \OCP\Files\Mount\IMountPoint[]
  68. * @since 8.2.0
  69. */
  70. public function findIn(string $path): array;
  71. /**
  72. * Remove all registered mounts
  73. *
  74. * @since 8.2.0
  75. */
  76. public function clear();
  77. /**
  78. * Find mounts by storage id
  79. *
  80. * @param string $id
  81. * @return \OCP\Files\Mount\IMountPoint[]
  82. * @since 8.2.0
  83. */
  84. public function findByStorageId(string $id): array;
  85. /**
  86. * @return \OCP\Files\Mount\IMountPoint[]
  87. * @since 8.2.0
  88. */
  89. public function getAll(): array;
  90. /**
  91. * Find mounts by numeric storage id
  92. *
  93. * @param int $id
  94. * @return \OCP\Files\Mount\IMountPoint[]
  95. * @since 8.2.0
  96. */
  97. public function findByNumericId(int $id): array;
  98. }