use of org.springframework.web.util.UriTemplate in project engine by craftercms.
the class ScriptUrlTemplateScannerImpl method scan.
@Override
public List<UriTemplate> scan(SiteContext siteContext) {
Context context = siteContext.getContext();
ContentStoreService storeService = siteContext.getStoreService();
ScriptFactory scriptFactory = siteContext.getScriptFactory();
List<String> scriptUrls = new ArrayList<>();
List<UriTemplate> urlTemplates = new ArrayList<>();
findScripts(context, storeService, scriptFactory, scriptsFolder, scriptUrls);
if (CollectionUtils.isNotEmpty(scriptUrls)) {
for (String scriptUrl : scriptUrls) {
Matcher matcher = urlVariablePlaceholderPattern.matcher(scriptUrl);
if (matcher.find()) {
urlTemplates.add(new UriTemplate(scriptUrl));
}
}
}
return urlTemplates;
}
Aggregations