return null;
}
public static List<MapEntry> createMapEntry(String url, final Resource resource,
final boolean trailingSlash) {
final ValueMap props = resource.adaptTo(ValueMap.class);
if (props != null) {
final String redirect = props.get(
MapEntries.PROP_REDIRECT_EXTERNAL, String.class);
if (redirect != null) {
// ignoring external redirects for mapping
LoggerFactory
.getLogger(MapEntry.class)
.info("createMapEntry: Configuration has external redirect to {}; not creating mapping for configuration in {}",
redirect, resource.getPath());
return null;
}
// ignore potential regular expression url
if (isRegExp(url)) {
LoggerFactory
.getLogger(MapEntry.class)
.info("createMapEntry: URL {} contains a regular expression; not creating mapping for configuration in {}",
url, resource.getPath());
return null;
}
// check whether the url is a match hooked to then string end
String endHook = "";
if (url.endsWith("$")) {
endHook = "$";
url = url.substring(0, url.length() - 1);
}
// check whether the url is for ANY_SCHEME_HOST
if (url.startsWith(MapEntries.ANY_SCHEME_HOST)) {
url = url.substring(MapEntries.ANY_SCHEME_HOST.length());
}
final String[] internalRedirect = props
.get(ResourceResolverImpl.PROP_REDIRECT_INTERNAL,
String[].class);
if (internalRedirect != null) {
// check whether the url is considered external or internal