use of com.thinkbiganalytics.metadata.modeshape.common.JcrObject in project kylo by Teradata.
the class JcrUtil method jcrObjectAsMap.
public static Map<String, Object> jcrObjectAsMap(JcrObject obj) {
String nodeName = obj.getNodeName();
String path = obj.getPath();
String identifier = null;
try {
identifier = obj.getObjectId();
} catch (AccessDeniedException e) {
log.debug("Access denied", e);
throw new AccessControlException(e.getMessage());
} catch (RepositoryException e) {
throw new RuntimeException(e);
}
String type = obj.getTypeName();
Map<String, Object> props = obj.getProperties();
Map<String, Object> finalProps = new HashMap<>();
if (props != null) {
finalProps.putAll(finalProps);
}
finalProps.put("nodeName", nodeName);
if (identifier != null) {
finalProps.put("nodeIdentifier", identifier);
}
finalProps.put("nodePath", path);
finalProps.put("nodeType", type);
return finalProps;
}
Aggregations