}
String resourcePath = null;
Resource resource = request.getResource();
if (resource == null) {
throw new ResourceNotFoundException("Resource not found.");
} else {
Item item = resource.adaptTo(Item.class);
if (item != null) {
resourcePath = item.getPath();
} else {
throw new ResourceNotFoundException("Resource is not a JCR Node");
}
}
AccessControlEntry[] declaredAccessControlEntries = getDeclaredAccessControlEntries(session, resourcePath);
Map<String, Map<String, Set<String>>> aclMap = new LinkedHashMap<String, Map<String,Set<String>>>();