jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1399587 - in /jackrabbit/branches/2.4: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValueFactory.java
Date Thu, 18 Oct 2012 11:37:34 GMT
Author: jukka
Date: Thu Oct 18 11:37:33 2012
New Revision: 1399587

URL: http://svn.apache.org/viewvc?rev=1399587&view=rev
Log:
2.4: Merged revision 1399576 (JCR-3447)

Modified:
    jackrabbit/branches/2.4/   (props changed)
    jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValueFactory.java

Propchange: jackrabbit/branches/2.4/
------------------------------------------------------------------------------
  Merged /jackrabbit/trunk:r1399576

Modified: jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValueFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValueFactory.java?rev=1399587&r1=1399586&r2=1399587&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValueFactory.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValueFactory.java
Thu Oct 18 11:37:33 2012
@@ -25,6 +25,8 @@ import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.commons.value.AbstractQValueFactory;
 
 import javax.jcr.RepositoryException;
+
+import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -92,7 +94,11 @@ public final class InternalValueFactory 
     }
 
     public QValue create(byte[] value) throws RepositoryException {
-        return InternalValue.create(value);
+        if (store == null) {
+            return InternalValue.create(value);
+        } else {
+            return InternalValue.create(new ByteArrayInputStream(value), store);
+        }
     }
 
     public QValue create(InputStream value) throws RepositoryException, IOException {
@@ -105,7 +111,11 @@ public final class InternalValueFactory 
 
     public QValue create(File value) throws RepositoryException, IOException {
         InputStream in = new FileInputStream(value);
-        return InternalValue.createTemporary(in);
+        if (store == null) {
+            return InternalValue.createTemporary(in);
+        } else {
+            return InternalValue.create(in, store);
+        }
     }
 
     @Override



Mime
View raw message