public function onPreFileDownload(CPlugin\PreFileDownloadEvent $ev)
    {
        if ($this->disabled) {
            return;
        }

        $scheme = parse_url($ev->getProcessedUrl(), PHP_URL_SCHEME);
        if (!in_array($scheme, self::$supportedSchemes, true)) {
            return;
        }

        $rfs = $ev->getRemoteFilesystem();
        $curlrfs = new CurlRemoteFilesystem(
            $this->io,
            $this->config,
            $rfs->getOptions()
        );
        $ev->setRemoteFilesystem($curlrfs);
    }