Author: cziegeler
Date: Thu Apr 25 17:02:20 2013
New Revision: 1475855

URL: http://svn.apache.org/r1475855
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

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=1475855&r1=1475854&r2=1475855&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:02:20 2013
@@ -548,6 +548,14 @@ public class JcrPropertyMap
         } 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;


Reply via email to