public function check(File $file)
    {
        if ($file->getUid() !== $this->uid) {
            throw new \Exception('This CachedFile is not for uid ['.$file->getUid().']');
        }

        return $this->hash === $this->hashFile($file);
    }