Solved
Programatically find out if a page is configured with vanities AEM 6.5
Hi
I would like to find out programatically if a page with Vanity was called.
This is what I tried:
public boolean getVerifyResourceVanity(Resource resource) {
if (resource == null) {
return false;
}
final String[] vanities = resource.getValueMap().get(VANITY_PROPERTY, new String[0]);
if (vanities.length == 0) {
return false;
}
final Matcher matcher = PREFIX_PATTERN.matcher(resource.getPath());
if (!matcher.find()) {
return false;
}
return true;
}
This information would help me disable a disclaimer when a page with Vanity was called.
Thanks.