Don't try to set type on root node by mkdir
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 8 May 2012 14:05:59 +0000 (14:05 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 8 May 2012 14:05:59 +0000 (14:05 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@5293 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

server/runtime/org.argeo.server.jcr/src/main/java/org/argeo/jcr/JcrUtils.java

index fdc69214942fde0a57b9ffd679b789097fc78ca9..39bdf34ba3ad61e87978ab4f183e2d9a95c5d849 100644 (file)
@@ -354,7 +354,8 @@ public class JcrUtils implements ArgeoJcrConstants {
                        if (session.itemExists(path)) {
                                Node node = session.getNode(path);
                                // check type
-                               if (type != null && !node.isNodeType(type))
+                               if (type != null && !node.isNodeType(type)
+                                               && !node.getPath().equals("/"))
                                        throw new ArgeoException("Node " + node
                                                        + " exists but is of type "
                                                        + node.getPrimaryNodeType().getName()