shareManager = $shareManager; } /** * @PublicPage * @NoAdminRequired * @NoCSRFRequired */ public function getByToken($token) { $share = $this->shareManager->getShareByToken($token); $node = $share->getNode(); $this->returnRawResponse($node); } /** * @PublicPage * @NoAdminRequired * @NoCSRFRequired */ public function getByTokenAndPath($token, $path) { $share = $this->shareManager->getShareByToken($token); $dirNode = $share->getNode(); if ($dirNode->getType() !== 'dir') { throw new Exception("Received a sub-path for a share that is not a directory"); } try { $fileNode = $dirNode->get($path); } catch (NotFoundException $e) { return new NotFoundResponse(); } $this->returnRawResponse($fileNode); } }