public function is_file_readable_locally_by_hash($contenthash, $fetchifnotfound = false) {
        if ($contenthash === file_storage::hash_from_string('')) {
            // Files with empty size are either directories or empty.
            // We handle these virtually.
            return true;
        }

        // This is called by file_storage::content_exists(), and in turn by the repository system.
        $path = $this->get_local_path_from_hash($contenthash, $fetchifnotfound);

        // Note - it is not possible to perform a content recovery safely from a hash alone.
        return is_readable($path);
    }