jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r780006 - in /jackrabbit/trunk: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/ jackrabbit-jcr-commons/s...
Date Fri, 29 May 2009 14:54:26 GMT
Author: stefan
Date: Fri May 29 14:54:25 2009
New Revision: 780006

URL: http://svn.apache.org/viewvc?rev=780006&view=rev
Log:
JCR-2056: Binary interfaces
JCR-1609: new Property Types


Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBInTempFile.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBValue.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/PropInfo.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractProperty.java
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BinaryImpl.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/QNodeTypeDefinitionImpl.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefReader.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefWriter.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueFactoryImpl.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueValue.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/ValueFormat.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QPropertyDefinitionImpl.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
Fri May 29 14:54:25 2009
@@ -438,7 +438,8 @@
         while (iter.hasNext()) {
             PropertyState prop = (PropertyState) iter.next();
             // being paranoid...
-            if (prop.getType() != PropertyType.REFERENCE) {
+            if (prop.getType() != PropertyType.REFERENCE
+                    && prop.getType() != PropertyType.WEAKREFERENCE) {
                 continue;
             }
             boolean modified = false;
@@ -1879,7 +1880,8 @@
                     }
                 }
 
-                if (newChildState.getType() == PropertyType.REFERENCE) {
+                if (newChildState.getType() == PropertyType.REFERENCE
+                        || newChildState.getType() == PropertyType.WEAKREFERENCE) {
                     refTracker.processedReference(newChildState);
                 }
                 // store new property

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
Fri May 29 14:54:25 2009
@@ -168,8 +168,12 @@
      */
     public int read(byte[] b, long position) throws IOException, RepositoryException {
         InputStream in = getStream();
-        in.skip(position);
-        return in.read(b);
+        try {
+            in.skip(position);
+            return in.read(b);
+        } finally {
+            in.close();
+        }
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBInTempFile.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBInTempFile.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBInTempFile.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBInTempFile.java
Fri May 29 14:54:25 2009
@@ -193,7 +193,11 @@
      */
     public int read(byte[] b, long position) throws IOException, RepositoryException {
         RandomAccessFile raf = new RandomAccessFile(file, "r");
-        raf.seek(position);
-        return raf.read(b);
+        try {
+            raf.seek(position);
+            return raf.read(b);
+        } finally {
+            raf.close();
+        }
     }
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBValue.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/BLOBValue.java
Fri May 29 14:54:25 2009
@@ -383,8 +383,12 @@
         if (file != null) {
             // this instance is backed by a temp file
             RandomAccessFile raf = new RandomAccessFile(file, "r");
-            raf.seek(position);
-            return raf.read(b);
+            try {
+                raf.seek(position);
+                return raf.read(b);
+            } finally {
+                raf.close();
+            }
         } else if (fsResource != null) {
             // this instance is backed by a resource in the virtual file system
             InputStream in;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/PropInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/PropInfo.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/PropInfo.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/PropInfo.java
Fri May 29 14:54:25 2009
@@ -153,7 +153,8 @@
             // can only be multi-valued (n == 0 || n > 1)
             node.setProperty(name, va, type);
         }
-        if (type == PropertyType.REFERENCE) {
+        if (type == PropertyType.REFERENCE
+                || type == PropertyType.WEAKREFERENCE) {
             // store reference for later resolution
             refTracker.processedReference(node.getProperty(name));
         }
@@ -215,7 +216,8 @@
         // make sure property is valid according to its definition
         itemOps.validate(prop);
 
-        if (prop.getType() == PropertyType.REFERENCE) {
+        if (prop.getType() == PropertyType.REFERENCE
+                || prop.getType() == PropertyType.WEAKREFERENCE) {
             // store reference for later resolution
             refTracker.processedReference(prop);
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
Fri May 29 14:54:25 2009
@@ -25,6 +25,7 @@
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.uuid.UUID;
 import org.apache.jackrabbit.value.ReferenceValue;
+import org.apache.jackrabbit.value.WeakReferenceValue;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -282,7 +283,8 @@
         while (iter.hasNext()) {
             Property prop = (Property) iter.next();
             // being paranoid...
-            if (prop.getType() != PropertyType.REFERENCE) {
+            if (prop.getType() != PropertyType.REFERENCE
+                    && prop.getType() != PropertyType.WEAKREFERENCE) {
                 continue;
             }
             if (prop.getDefinition().isMultiple()) {
@@ -293,7 +295,9 @@
                     UUID original = UUID.fromString(val.getString());
                     UUID adjusted = refTracker.getMappedUUID(original);
                     if (adjusted != null) {
-                        newVals[i] = new ReferenceValue(session.getNodeByUUID(adjusted));
+                        newVals[i] = session.getValueFactory().createValue(
+                                session.getNodeByUUID(adjusted),
+                                prop.getType() != PropertyType.REFERENCE);
                     } else {
                         // reference doesn't need adjusting, just copy old value
                         newVals[i] = val;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
Fri May 29 14:54:25 2009
@@ -598,7 +598,8 @@
             while (iter.hasNext()) {
                 PropertyState prop = (PropertyState) iter.next();
                 // being paranoid...
-                if (prop.getType() != PropertyType.REFERENCE) {
+                if (prop.getType() != PropertyType.REFERENCE
+                    && prop.getType() != PropertyType.WEAKREFERENCE) {
                     continue;
                 }
                 boolean modified = false;
@@ -609,7 +610,9 @@
                     UUID original = val.getUUID();
                     UUID adjusted = refTracker.getMappedUUID(original);
                     if (adjusted != null) {
-                        newVals[i] = InternalValue.create(adjusted);
+                        newVals[i] = InternalValue.create(
+                                adjusted,
+                                prop.getType() != PropertyType.REFERENCE);
                         modified = true;
                     } else {
                         // reference doesn't need adjusting, just copy old value

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractProperty.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractProperty.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractProperty.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/AbstractProperty.java
Fri May 29 14:54:25 2009
@@ -218,7 +218,8 @@
     public Node getNode() throws RepositoryException {
         Session session = getSession();
         Value value = getValue();
-        if (value.getType() != PropertyType.REFERENCE) {
+        if (value.getType() != PropertyType.REFERENCE
+                && value.getType() != PropertyType.WEAKREFERENCE) {
             value = session.getValueFactory().createValue(
                     value.getString(), PropertyType.REFERENCE);
         }

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BinaryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BinaryImpl.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BinaryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/value/BinaryImpl.java
Fri May 29 14:54:25 2009
@@ -145,8 +145,12 @@
         if (tmpFile != null) {
             // this instance is backed by a temp file
             RandomAccessFile raf = new RandomAccessFile(tmpFile, "r");
-            raf.seek(position);
-            return raf.read(b);
+            try {
+                raf.seek(position);
+                return raf.read(b);
+            } finally {
+                raf.close();
+            }
         } else {
             // this instance is backed by an in-memory buffer
             int length = Math.min(b.length, buffer.length - (int) position);

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/QNodeTypeDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/QNodeTypeDefinitionImpl.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/QNodeTypeDefinitionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/QNodeTypeDefinitionImpl.java
Fri May 29 14:54:25 2009
@@ -326,8 +326,9 @@
             }
             // property definitions
             for (int i = 0; i < propertyDefs.length; i++) {
-                // REFERENCE value constraints
-                if (propertyDefs[i].getRequiredType() == PropertyType.REFERENCE) {
+                // [WEAK]REFERENCE value constraints
+                if (propertyDefs[i].getRequiredType() == PropertyType.REFERENCE
+                        || propertyDefs[i].getRequiredType() == PropertyType.WEAKREFERENCE)
{
                     String[] ca = propertyDefs[i].getValueConstraints();
                     if (ca != null) {
                         for (int j = 0; j < ca.length; j++) {

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefReader.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefReader.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefReader.java
Fri May 29 14:54:25 2009
@@ -415,6 +415,8 @@
             pd.setRequiredType(PropertyType.BINARY);
         } else if (currentTokenEquals(Lexer.LONG)) {
             pd.setRequiredType(PropertyType.LONG);
+        } else if (currentTokenEquals(Lexer.DECIMAL)) {
+            pd.setRequiredType(PropertyType.DECIMAL);
         } else if (currentTokenEquals(Lexer.DOUBLE)) {
             pd.setRequiredType(PropertyType.DOUBLE);
         } else if (currentTokenEquals(Lexer.BOOLEAN)) {
@@ -425,8 +427,12 @@
             pd.setRequiredType(PropertyType.NAME);
         } else if (currentTokenEquals(Lexer.PATH)) {
             pd.setRequiredType(PropertyType.PATH);
+        } else if (currentTokenEquals(Lexer.URI)) {
+            pd.setRequiredType(PropertyType.URI);
         } else if (currentTokenEquals(Lexer.REFERENCE)) {
             pd.setRequiredType(PropertyType.REFERENCE);
+        } else if (currentTokenEquals(Lexer.WEAKREFERENCE)) {
+            pd.setRequiredType(PropertyType.WEAKREFERENCE);
         } else if (currentTokenEquals(Lexer.UNDEFINED)) {
             pd.setRequiredType(PropertyType.UNDEFINED);
         } else {

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefWriter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefWriter.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefWriter.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/compact/CompactNodeTypeDefWriter.java
Fri May 29 14:54:25 2009
@@ -322,9 +322,14 @@
     }
 
     private String convertConstraint(String vc, int type) {
-        if (type == PropertyType.REFERENCE || type == PropertyType.NAME || type == PropertyType.PATH)
{
-            if (type == PropertyType.REFERENCE)
+        if (type == PropertyType.REFERENCE
+                || type == PropertyType.WEAKREFERENCE
+                || type == PropertyType.NAME
+                || type == PropertyType.PATH) {
+            if (type == PropertyType.REFERENCE
+                    || type == PropertyType.WEAKREFERENCE) {
                 type = PropertyType.NAME;
+            }
 
             try {
                 QValue qv = QValueFactoryImpl.getInstance().create(vc, type);

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueFactoryImpl.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueFactoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueFactoryImpl.java
Fri May 29 14:54:25 2009
@@ -289,8 +289,12 @@
 
                 public int read(byte[] b, long position) throws IOException, RepositoryException
{
                     InputStream in = getStream();
-                    in.skip(position);
-                    return in.read(b);
+                    try {
+                        in.skip(position);
+                        return in.read(b);
+                    } finally {
+                        in.close();
+                    }
                 }
 
                 public long getSize() throws RepositoryException {

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueValue.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueValue.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/QValueValue.java
Fri May 29 14:54:25 2009
@@ -110,8 +110,7 @@
      * @see javax.jcr.Value#getBinary()
      */
     public Binary getBinary() throws RepositoryException {
-        // TODO
-        throw new RuntimeException("Not implemented yet, see JCR-2056");
+        return qvalue.getBinary();
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/ValueFormat.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/ValueFormat.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/ValueFormat.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/value/ValueFormat.java
Fri May 29 14:54:25 2009
@@ -52,6 +52,7 @@
         } else if (jcrValue.getType() == PropertyType.BINARY) {
             // TODO: jsr 283 binary property conversion
             try {
+                //return factory.create(jcrValue.getBinary());
                 return factory.create(jcrValue.getStream());
             } catch (IOException e) {
                 throw new RepositoryException(e);
@@ -168,8 +169,7 @@
                     jcrValue = factory.createValue(qualifiedValue.getBoolean());
                     break;
                 case PropertyType.BINARY:
-                    // TODO: jsr 283 binary handling
-                    jcrValue = factory.createValue(qualifiedValue.getStream());
+                    jcrValue = factory.createValue(qualifiedValue.getBinary());
                     break;
                 case PropertyType.DATE:
                     jcrValue = factory.createValue(qualifiedValue.getCalendar());

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java
Fri May 29 14:54:25 2009
@@ -240,8 +240,9 @@
             }
             // property definitions
             for (int i = 0; i < propDefs.length; i++) {
-                // REFERENCE value constraints
-                if (propDefs[i].getRequiredType() == PropertyType.REFERENCE) {
+                // [WEAK]REFERENCE value constraints
+                if (propDefs[i].getRequiredType() == PropertyType.REFERENCE
+                        || propDefs[i].getRequiredType() == PropertyType.WEAKREFERENCE) {
                     String[] ca = propDefs[i].getValueConstraints();
                     if (ca != null) {
                         for (int j = 0; j < ca.length; j++) {

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QPropertyDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QPropertyDefinitionImpl.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QPropertyDefinitionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QPropertyDefinitionImpl.java
Fri May 29 14:54:25 2009
@@ -131,7 +131,8 @@
             List vc = new ArrayList();
             ElementIterator it = DomUtil.getChildren(child, VALUECONSTRAINT_ELEMENT, null);
             while (it.hasNext()) {
-                int constType = (requiredType == PropertyType.REFERENCE) ?  PropertyType.NAME
: requiredType;
+                int constType = (requiredType == PropertyType.REFERENCE
+                        || requiredType == PropertyType.WEAKREFERENCE) ?  PropertyType.NAME
: requiredType;
                 String qValue = DomUtil.getText(it.nextElement());
                 // in case of name and path constraint, the value must be
                 // converted to be in qualified format

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java?rev=780006&r1=780005&r2=780006&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java
Fri May 29 14:54:25 2009
@@ -198,7 +198,7 @@
     }
 
     /**
-     * @see QValueFactory#create(BigDecimal)
+     * @see QValueFactory#create(URI)
      */
     public QValue create(BigDecimal value) {
         return new QValueImpl(value);
@@ -442,8 +442,12 @@
 
                 public int read(byte[] b, long position) throws IOException, RepositoryException
{
                     InputStream in = getStream();
-                    in.skip(position);
-                    return in.read(b);
+                    try {
+                        in.skip(position);
+                        return in.read(b);
+                    } finally {
+                        in.close();
+                    }
                 }
 
                 public long getSize() throws RepositoryException {
@@ -856,8 +860,12 @@
 
                 public int read(byte[] b, long position) throws IOException, RepositoryException
{
                     InputStream in = getStream();
-                    in.skip(position);
-                    return in.read(b);
+                    try {
+                        in.skip(position);
+                        return in.read(b);
+                    } finally {
+                        in.close();
+                    }
                 }
 
                 public long getSize() throws RepositoryException {



Mime
View raw message