public DownloadTargets apply(DownloadRequirement req) { Boolean enabled = config.getConfig(CLOUDSOFT_REPO_ENABLED); String baseUrl = config.getConfig(CLOUDSOFT_REPO_URL); String url = String.format(CLOUDSOFT_REPO_URL_PATTERN, baseUrl); if (enabled) { Map<String, ?> subs = DownloadSubstituters.getBasicSubstitutions(req); String result = DownloadSubstituters.substitute(url, subs); return BasicDownloadTargets.builder().addPrimary(result).build(); } else { return BasicDownloadTargets.empty(); } }