IMountManager.php 2.3 KB

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