* @return
* @throws RepositoryException
*/
private ItemData createItemData(ItemState state, Path path, boolean permissionCheck) throws RepositoryException {
ItemData data;
ItemId id = state.getId();
if (id.equals(rootNodeId)) {
// special handling required for root node
data = new NodeData((NodeState) state, rootNodeDef);
} else if (state.isNode()) {
NodeState nodeState = (NodeState) state;
data = new NodeData(nodeState, getDefinition(nodeState));