Author: chetanm
Date: Wed Mar 26 08:02:23 2014
New Revision: 1581727

URL: http://svn.apache.org/r1581727
Log:
OAK-1604 - Support for signed references in Blob (WIP)

Adapt DocumentNodeStore to use right method for fetching blob details with 
blobId

Modified:
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java?rev=1581727&r1=1581726&r2=1581727&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
 Wed Mar 26 08:02:23 2014
@@ -1213,7 +1213,8 @@ public final class DocumentNodeStore
     }
 
     /**
-     * Returns the {@link Blob} with the given blobId.
+     * Returns the {@link Blob} with the given reference. Note that this 
method is meant to
+     * be used with secure reference obtained from Blob#reference which is 
different from blobId
      *
      * @param reference the reference of the blob.
      * @return the blob.
@@ -1228,6 +1229,16 @@ public final class DocumentNodeStore
         return null;
     }
 
+    /**
+     * Returns the {@link Blob} with the given blobId.
+     *
+     * @param reference the reference of the blob.
+     * @return the blob.
+     */
+    public Blob getBlobFromBlobId(String blobId){
+        return new BlobStoreBlob(blobStore, blobId);
+    }
+
     @Nonnull
     @Override
     public String checkpoint(long lifetime) {

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java?rev=1581727&r1=1581726&r2=1581727&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentPropertyState.java
 Wed Mar 26 08:02:23 2014
@@ -188,7 +188,8 @@ final class DocumentPropertyState implem
                 int type = TypeCodes.decodeType(split, jsonString);
                 String value = TypeCodes.decodeName(split, jsonString);
                 if (type == PropertyType.BINARY) {
-                    return  BinaryPropertyState.binaryProperty(name, 
store.getBlob(value));
+
+                    return  BinaryPropertyState.binaryProperty(name, 
store.getBlobFromBlobId(value));
                 } else {
                     return createProperty(name, StringCache.get(value), type);
                 }


Reply via email to