org.apache.sling.bgservlets.impl

## Class DeepNodeCreator

- java.lang.Object
- - org.apache.sling.bgservlets.impl.DeepNodeCreator

    public class DeepNodeCreator
    extends Object

Deep-creation of nodes: parent nodes are created if needed. TOO replace with the version of JCR-2687 once that's released.

### Constructor Summary

Constructors
Constructor and Description
`DeepNodeCreator()`

### Method Summary

Methods
`javax.jcr.Node` `deepCreateNode(String path, javax.jcr.Session session, String nodeType)` Create a node, also creating parent nodes as needed
`protected String` `getNodeType(javax.jcr.Node parent, String childPath, String suggestedNodeType)` Can be overridden to return a specific nodetype to use at a given path.
`protected void` `nodeCreated(javax.jcr.Node n)` Can be overridden to customize the created nodes, add mixins etc.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DeepNodeCreator

    public DeepNodeCreator()

### Method Detail

#### deepCreateNode

    public javax.jcr.Node deepCreateNode(String path,
                                javax.jcr.Session session,
                                String nodeType)
                                  throws javax.jcr.RepositoryException

Create a node, also creating parent nodes as needed

Parameters:
  `path` - Path of the node to create
  `session` - Used to create nodes
  `nodeType` - Node type of created nodes, can be overridden via `getNodeType(javax.jcr.Node, java.lang.String, java.lang.String)`
Returns:
  The created node
Throws:
  `javax.jcr.RepositoryException` - In case of problems

#### getNodeType

    protected String getNodeType(javax.jcr.Node parent,
                     String childPath,
                     String suggestedNodeType)
                          throws javax.jcr.RepositoryException

Can be overridden to return a specific nodetype to use at a given path.

Parameters:
  `parent` - the parent of the node that is being created
  `childPath` - the path of the child that is being created
  `suggestedNodeType` - the nodeType value passed to `deepCreateNode`
Returns:
  suggestedNodeType by default
Throws:
  `javax.jcr.RepositoryException`

#### nodeCreated

    protected void nodeCreated(javax.jcr.Node n)
                        throws javax.jcr.RepositoryException

Can be overridden to customize the created nodes, add mixins etc.

Throws:
  `javax.jcr.RepositoryException`