jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1136456 - /jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ItemInfoBuilder.java
Date Thu, 16 Jun 2011 14:32:06 GMT
Author: mduerig
Date: Thu Jun 16 14:32:05 2011
New Revision: 1136456

URL: http://svn.apache.org/viewvc?rev=1136456&view=rev
Log:
JCR-2993: Add method to set uuid in NodeInfoBuilder

Modified:
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ItemInfoBuilder.java

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ItemInfoBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ItemInfoBuilder.java?rev=1136456&r1=1136455&r2=1136456&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ItemInfoBuilder.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/ItemInfoBuilder.java
Thu Jun 16 14:32:05 2011
@@ -164,6 +164,7 @@ public final class ItemInfoBuilder {
         private String namespace;
         private Name name;
         private int index = Path.INDEX_DEFAULT;
+        private String uuid;
         private Name primaryTypeName = NameConstants.NT_UNSTRUCTURED;
         private final List<Name> mixins = new ArrayList<Name>();
         private boolean includeChildInfos = true;
@@ -284,6 +285,17 @@ public final class ItemInfoBuilder {
         }
 
         /**
+         * Set the uuid
+         *
+         * @param uuid
+         * @return
+         */
+        public NodeInfoBuilder setUUID(String uuid) {
+            this.uuid = uuid;
+            return this;
+        }
+
+        /**
          * Set the parent's path of the node
          * 
          * @param parentPath
@@ -347,7 +359,7 @@ public final class ItemInfoBuilder {
                 stale = true;
                 NodeId id = getId();
 
-                nodeInfo = new NodeInfoImpl(id.getPath(), id, index, primaryTypeName,
+                nodeInfo = new NodeInfoImpl(getPath(), id, index, primaryTypeName,
                         mixins.toArray(new Name[mixins.size()]), Iterators.<PropertyId>empty(),
                         getPropertyIds(), includeChildInfos ? getChildInfos() : null);
 
@@ -409,7 +421,12 @@ public final class ItemInfoBuilder {
         }
 
         private NodeId getId() throws RepositoryException {
-            return IdFactoryImpl.getInstance().createNodeId((String) null, getPath());
+            if (uuid == null) {
+                return IdFactoryImpl.getInstance().createNodeId((String) null, getPath());
+            }
+            else {
+                return IdFactoryImpl.getInstance().createNodeId(uuid);
+            }
         }
 
         private Path getPath() throws RepositoryException {



Mime
View raw message