/** * set a fix Mountpoint in FSTAB by UUID for SDA-Device to prevent different Mountpoints on Bootup */ public function addMountpointSDA() { $this->getMountsFstab(); $this->getMountpointsSDA(); foreach ($_REQUEST['fixmount'] as $device => $value) { if (!isset($this->view->mountpointsSDA[$device]['fixmounted']) || $this->view->mountpointsSDA[$device]['fixmounted'] == false) { $m = new Mount(); $test1 = $m->setMountpoint('UUID=' . $this->view->mountpointsSDA[$device]['uuid']); $test2 = $m->setPath($this->view->mountpointsSDA[$device]['path']); $test3 = $m->setType($this->view->mountpointsSDA[$device]['type']); $test4 = $m->setOptions('defaults,nobootwait'); $this->addMount($m); } } return true; }
/** * clear all mounts and storage backends */ public static function clearMounts() { Mount::clear(); }
/** * Get the path of a file by id, relative to the view * * Note that the resulting path is not guarantied to be unique for the id, multiple paths can point to the same file * * @param int $id * @return string */ public function getPath($id) { list($storage, $internalPath) = Cache\Cache::getById($id); $mounts = Mount::findByStorageId($storage); foreach ($mounts as $mount) { /** * @var \OC\Files\Mount $mount */ $fullPath = $mount->getMountPoint() . $internalPath; if (!is_null($path = $this->getRelativePath($fullPath))) { return $path; } } return null; }