/**
  * @param int $id
  * @return TemporaryFile
  * @throws RestException
  */
 private function getFile($id)
 {
     try {
         $file = $this->file_manager->getFile($id);
     } catch (FileNotFoundException $e) {
         $this->raiseError(404);
     }
     $this->checkTemporaryFileBelongsToCurrentUser($file);
     return $file;
 }