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.

131 lines
2.7 KiB

3 years ago
  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. *
  8. * @license AGPL-3.0
  9. *
  10. * This code is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License, version 3,
  12. * as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License, version 3,
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>
  21. *
  22. */
  23. namespace OCP\Files\Mount;
  24. /**
  25. * A storage mounted to folder on the filesystem
  26. * @since 8.0.0
  27. */
  28. interface IMountPoint {
  29. /**
  30. * get complete path to the mount point
  31. *
  32. * @return string
  33. * @since 8.0.0
  34. */
  35. public function getMountPoint();
  36. /**
  37. * Set the mountpoint
  38. *
  39. * @param string $mountPoint new mount point
  40. * @since 8.0.0
  41. */
  42. public function setMountPoint($mountPoint);
  43. /**
  44. * Get the storage that is mounted
  45. *
  46. * @return \OC\Files\Storage\Storage
  47. * @since 8.0.0
  48. */
  49. public function getStorage();
  50. /**
  51. * Get the id of the storages
  52. *
  53. * @return string
  54. * @since 8.0.0
  55. */
  56. public function getStorageId();
  57. /**
  58. * Get the id of the storages
  59. *
  60. * @return int
  61. * @since 9.1.0
  62. */
  63. public function getNumericStorageId();
  64. /**
  65. * Get the path relative to the mountpoint
  66. *
  67. * @param string $path absolute path to a file or folder
  68. * @return string
  69. * @since 8.0.0
  70. */
  71. public function getInternalPath($path);
  72. /**
  73. * Apply a storage wrapper to the mounted storage
  74. *
  75. * @param callable $wrapper
  76. * @since 8.0.0
  77. */
  78. public function wrapStorage($wrapper);
  79. /**
  80. * Get a mount option
  81. *
  82. * @param string $name Name of the mount option to get
  83. * @param mixed $default Default value for the mount option
  84. * @return mixed
  85. * @since 8.0.0
  86. */
  87. public function getOption($name, $default);
  88. /**
  89. * Get all options for the mount
  90. *
  91. * @return array
  92. * @since 8.1.0
  93. */
  94. public function getOptions();
  95. /**
  96. * Get the file id of the root of the storage
  97. *
  98. * @return int
  99. * @since 9.1.0
  100. */
  101. public function getStorageRootId();
  102. /**
  103. * Get the id of the configured mount
  104. *
  105. * @return int|null mount id or null if not applicable
  106. * @since 9.1.0
  107. */
  108. public function getMountId();
  109. /**
  110. * Get the type of mount point, used to distinguish things like shares and external storages
  111. * in the web interface
  112. *
  113. * @return string
  114. * @since 12.0.0
  115. */
  116. public function getMountType();
  117. }