code: public Node getOrCreateDataNode(Node rootNode, String dataId, String nodeType, List<String> mixinTypes,
        Map<String, String[]> permissions) throws RepositoryException
     {
        try
        {
           return getDataNode(rootNode, dataId);
        }
        catch (PathNotFoundException e)
        {
           if (LOG.isTraceEnabled())
           {
              LOG.trace("An exception occurred: " + e.getMessage());
           }
  
        }
        // The node could not be found so we need to create it
        Node node = rootNode;
        List<String> ancestors = getAncestors(dataId);
        for (int i = 0, length = ancestors.size(); i < length; i++)
        {
           String nodeName = ancestors.get(i);
           try
           {
              node = node.getNode(nodeName);
              continue;
           }
           catch (PathNotFoundException e)
           {
              if (LOG.isTraceEnabled())
              {
                 LOG.trace("An exception occurred: " + e.getMessage());
              }
  
           }
           // The node doesn't exist we need to create it
           node = createNode(node, nodeName, nodeType, mixinTypes, permissions, i == length - 1, true);
        }
        return node;
     }
docs: {@inheritDoc}