IMountPoint.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Morris Jobke <hey@morrisjobke.de>
  6. * @author Robin Appelman <robin@icewind.nl>
  7. * @author szaimen <szaimen@e.mail.de>
  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. * A storage mounted to folder on the filesystem
  27. * @since 8.0.0
  28. */
  29. interface IMountPoint {
  30. /**
  31. * get complete path to the mount point
  32. *
  33. * @return string
  34. * @since 8.0.0
  35. */
  36. public function getMountPoint();
  37. /**
  38. * Set the mountpoint
  39. *
  40. * @param string $mountPoint new mount point
  41. * @since 8.0.0
  42. */
  43. public function setMountPoint($mountPoint);
  44. /**
  45. * Get the storage that is mounted
  46. *
  47. * @return \OCP\Files\Storage\IStorage|null
  48. * @since 8.0.0
  49. */
  50. public function getStorage();
  51. /**
  52. * Get the id of the storages
  53. *
  54. * @return string|null
  55. * @since 8.0.0
  56. */
  57. public function getStorageId();
  58. /**
  59. * Get the id of the storages
  60. *
  61. * @return int|null
  62. * @since 9.1.0
  63. */
  64. public function getNumericStorageId();
  65. /**
  66. * Get the path relative to the mountpoint
  67. *
  68. * @param string $path absolute path to a file or folder
  69. * @return string
  70. * @since 8.0.0
  71. */
  72. public function getInternalPath($path);
  73. /**
  74. * Apply a storage wrapper to the mounted storage
  75. *
  76. * @param callable $wrapper
  77. * @since 8.0.0
  78. */
  79. public function wrapStorage($wrapper);
  80. /**
  81. * Get a mount option
  82. *
  83. * @param string $name Name of the mount option to get
  84. * @param mixed $default Default value for the mount option
  85. * @return mixed
  86. * @since 8.0.0
  87. */
  88. public function getOption($name, $default);
  89. /**
  90. * Get all options for the mount
  91. *
  92. * @return array
  93. * @since 8.1.0
  94. */
  95. public function getOptions();
  96. /**
  97. * Get the file id of the root of the storage
  98. *
  99. * @return int
  100. * @since 9.1.0
  101. */
  102. public function getStorageRootId();
  103. /**
  104. * Get the id of the configured mount
  105. *
  106. * @return int|null mount id or null if not applicable
  107. * @since 9.1.0
  108. */
  109. public function getMountId();
  110. /**
  111. * Get the type of mount point, used to distinguish things like shares and external storage
  112. * in the web interface
  113. *
  114. * @return string
  115. * @since 12.0.0
  116. */
  117. public function getMountType();
  118. /**
  119. * Get the class of the mount provider that this mount originates from
  120. *
  121. * @return string
  122. * @since 24.0.0
  123. */
  124. public function getMountProvider(): string;
  125. }