1
0

IMountManager.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 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 IMountPoint
  60. * @since 8.2.0
  61. */
  62. public function find(string $path): ?IMountPoint;
  63. /**
  64. * Find all mounts in $path
  65. *
  66. * @param string $path
  67. * @return 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 IMountPoint[]
  82. * @since 8.2.0
  83. */
  84. public function findByStorageId(string $id): array;
  85. /**
  86. * @return 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 IMountPoint[]
  95. * @since 8.2.0
  96. */
  97. public function findByNumericId(int $id): array;
  98. }