OCA\Richdocuments\Controller\DocumentController::download PHP Метод

download() публичный Метод

public download ( $path )
    public function download($path)
    {
        if (!$path) {
            $response = new JSONResponse();
            $response->setStatus(Http::STATUS_BAD_REQUEST);
            return $response;
        }
        $fullPath = '/files' . $path;
        $fileInfo = \OC\Files\Filesystem::getFileInfo($path);
        if ($fileInfo) {
            $file = new File($fileInfo->getId());
            $genesis = new Genesis($file);
            $fullPath = $genesis->getPath();
        }
        return new DownloadResponse($this->request, $this->uid, $fullPath);
    }