You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2013/04/25 19:11:43 UTC

svn commit: r1475856 - in /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource: JcrPropertyMap.java internal/JcrModifiableValueMap.java

Author: cziegeler
Date: Thu Apr 25 17:11:43 2013
New Revision: 1475856

URL: http://svn.apache.org/r1475856
Log:
SLING-2842 :  Provide a way to get the ObjectInputStream for serialized java objects 

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java?rev=1475856&r1=1475855&r2=1475856&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/JcrPropertyMap.java Thu Apr 25 17:11:43 2013
@@ -260,7 +260,7 @@ public class JcrPropertyMap
             final String name = prop.getName();
             String key = null;
             if ( name.indexOf("_x") != -1 ) {
-                // for compatiblity with older versions we use the (wrong)
+                // for compatibility with older versions we use the (wrong)
                 // ISO9075 path encoding
                 key = ISO9075.decode(name);
                 if ( key.equals(name) ) {
@@ -352,7 +352,7 @@ public class JcrPropertyMap
         }
 
         try {
-            // for compatiblity with older versions we use the (wrong) ISO9075 path
+            // for compatibility with older versions we use the (wrong) ISO9075 path
             // encoding
             final String oldKey = ISO9075.encodePath(name);
             if (node.hasProperty(oldKey)) {

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java?rev=1475856&r1=1475855&r2=1475856&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrModifiableValueMap.java Thu Apr 25 17:11:43 2013
@@ -343,7 +343,7 @@ public final class JcrModifiableValueMap
         }
 
         try {
-            // for compatiblity with older versions we use the (wrong) ISO9075 path
+            // for compatibility with older versions we use the (wrong) ISO9075 path
             // encoding
             final String oldKey = ISO9075.encodePath(name);
             if (node.hasProperty(oldKey)) {
@@ -521,6 +521,14 @@ public final class JcrModifiableValueMap
         } else if (Property.class == type) {
             return (T) entry.property;
 
+        } else if (ObjectInputStream.class == type) {
+            if ( jcrValue.getType() == PropertyType.BINARY ) {
+                try {
+                    return (T) new ObjectInputStream(jcrValue.getBinary().getStream(), this.dynamicClassLoader);
+                } catch (IOException ioe) {
+                    // ignore and use fallback
+                }
+            }
         } else if (Serializable.class.isAssignableFrom(type)
                 && jcrValue.getType() == PropertyType.BINARY) {
             ObjectInputStream ois = null;