public function process() {
        $backuptempdir = make_backup_temp_directory('');
        if ($this->filename) {
            $archivepath = $backuptempdir . '/' . $this->filename;
            if (!file_exists($archivepath)) {
                throw new restore_ui_exception('invalidrestorefile');
            }
            $outcome = $this->extract_file_to_dir($archivepath);
            if ($outcome) {
                fulldelete($archivepath);
            }
        } else {
            $fs = get_file_storage();
            $storedfile = $fs->get_file_by_hash($this->pathnamehash);
            if (!$storedfile || $storedfile->get_contenthash() !== $this->contenthash) {
                throw new restore_ui_exception('invalidrestorefile');
            }
            $outcome = $this->extract_file_to_dir($storedfile);
        }
        return $outcome;
    }