/**
  * @throws 401
  * @throws 404
  */
 private function getTemporaryFileContent($id, $offset, $limit)
 {
     $file = $this->getFile($id);
     try {
         return $this->file_manager->getTemporaryFileChunk($file, $offset, $limit);
     } catch (FileNotFoundException $e) {
         throw new RestException(404);
     }
 }