/** * 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; }