IMountPoint.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCP\Files\Mount;
  8. /**
  9. * A storage mounted to folder on the filesystem
  10. * @since 8.0.0
  11. */
  12. interface IMountPoint {
  13. /**
  14. * get complete path to the mount point
  15. *
  16. * @return string
  17. * @since 8.0.0
  18. */
  19. public function getMountPoint();
  20. /**
  21. * Set the mountpoint
  22. *
  23. * @param string $mountPoint new mount point
  24. * @since 8.0.0
  25. */
  26. public function setMountPoint($mountPoint);
  27. /**
  28. * Get the storage that is mounted
  29. *
  30. * @return \OCP\Files\Storage\IStorage|null
  31. * @since 8.0.0
  32. */
  33. public function getStorage();
  34. /**
  35. * Get the id of the storages
  36. *
  37. * @return string|null
  38. * @since 8.0.0
  39. */
  40. public function getStorageId();
  41. /**
  42. * Get the id of the storages
  43. *
  44. * @return int|null
  45. * @since 9.1.0
  46. */
  47. public function getNumericStorageId();
  48. /**
  49. * Get the path relative to the mountpoint
  50. *
  51. * @param string $path absolute path to a file or folder
  52. * @return string
  53. * @since 8.0.0
  54. */
  55. public function getInternalPath($path);
  56. /**
  57. * Apply a storage wrapper to the mounted storage
  58. *
  59. * @param callable $wrapper
  60. * @since 8.0.0
  61. */
  62. public function wrapStorage($wrapper);
  63. /**
  64. * Get a mount option
  65. *
  66. * @param string $name Name of the mount option to get
  67. * @param mixed $default Default value for the mount option
  68. * @return mixed
  69. * @since 8.0.0
  70. */
  71. public function getOption($name, $default);
  72. /**
  73. * Get all options for the mount
  74. *
  75. * @return array
  76. * @since 8.1.0
  77. */
  78. public function getOptions();
  79. /**
  80. * Get the file id of the root of the storage
  81. *
  82. * @return int
  83. * @since 9.1.0
  84. */
  85. public function getStorageRootId();
  86. /**
  87. * Get the id of the configured mount
  88. *
  89. * @return int|null mount id or null if not applicable
  90. * @since 9.1.0
  91. */
  92. public function getMountId();
  93. /**
  94. * Get the type of mount point, used to distinguish things like shares and external storage
  95. * in the web interface
  96. *
  97. * @return string
  98. * @since 12.0.0
  99. */
  100. public function getMountType();
  101. /**
  102. * Get the class of the mount provider that this mount originates from
  103. *
  104. * @return string
  105. * @since 24.0.0
  106. */
  107. public function getMountProvider(): string;
  108. }