jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r800863 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java
Date Tue, 04 Aug 2009 16:24:18 GMT
Author: jukka
Date: Tue Aug  4 16:24:17 2009
New Revision: 800863

URL: http://svn.apache.org/viewvc?rev=800863&view=rev
Log:
JCR-442: Implement a backup tool

Fix binary property handling.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java?rev=800863&r1=800862&r2=800863&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java
Tue Aug  4 16:24:17 2009
@@ -143,10 +143,8 @@
             targetState.setDefinitionId(sourceState.getDefinitionId());
             targetState.setType(sourceState.getType());
             targetState.setMultiValued(sourceState.isMultiValued());
-            if (sourceState.getType() != PropertyType.BINARY) {
-                targetState.setValues(sourceState.getValues());
-            } else {
-                InternalValue[] values = sourceState.getValues();
+            InternalValue[] values = sourceState.getValues();
+            if (sourceState.getType() == PropertyType.BINARY) {
                 for (int i = 0; i < values.length; i++) {
                     InputStream stream = values[i].getStream();
                     try {
@@ -156,6 +154,7 @@
                     }
                 }
             }
+            targetState.setValues(values);
             if (target.exists(targetState.getPropertyId())) {
                 changes.modified(targetState);
             } else {



Mime
View raw message