1<?php 2/** 3 * @author Morris Jobke <hey@morrisjobke.de> 4 * @author Robin Appelman <icewind@owncloud.com> 5 * 6 * @copyright Copyright (c) 2018, ownCloud GmbH 7 * @license AGPL-3.0 8 * 9 * This code is free software: you can redistribute it and/or modify 10 * it under the terms of the GNU Affero General Public License, version 3, 11 * as published by the Free Software Foundation. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU Affero General Public License for more details. 17 * 18 * You should have received a copy of the GNU Affero General Public License, version 3, 19 * along with this program. If not, see <http://www.gnu.org/licenses/> 20 * 21 */ 22 23namespace OCP\Files\Mount; 24 25/** 26 * A storage mounted to folder on the filesystem 27 * @since 8.0.0 28 */ 29interface IMountPoint { 30 31 /** 32 * get complete path to the mount point 33 * 34 * @return string 35 * @since 8.0.0 36 */ 37 public function getMountPoint(); 38 39 /** 40 * Set the mountpoint 41 * 42 * @param string $mountPoint new mount point 43 * @since 8.0.0 44 */ 45 public function setMountPoint($mountPoint); 46 47 /** 48 * Get the storage that is mounted 49 * 50 * @return \OC\Files\Storage\Storage 51 * @since 8.0.0 52 */ 53 public function getStorage(); 54 55 /** 56 * Get the id of the storages 57 * 58 * @return string 59 * @since 8.0.0 60 */ 61 public function getStorageId(); 62 63 /** 64 * Get the path relative to the mountpoint 65 * 66 * @param string $path absolute path to a file or folder 67 * @return string 68 * @since 8.0.0 69 */ 70 public function getInternalPath($path); 71 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 /** 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 /** 91 * Get all options for the mount 92 * 93 * @return array 94 * @since 8.1.0 95 */ 96 public function getOptions(); 97 98 /** 99 * Get the file id of the root of the storage 100 * 101 * @return int storage numeric id or -1 in case of invalid storage 102 * @since 9.1.0 103 */ 104 public function getStorageRootId(); 105} 106