Author: tolusha
Date: 2010-06-30 09:23:12 -0400 (Wed, 30 Jun 2010)
New Revision: 2726
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/DocumentViewImporter.java
Log:
EXOJCR-817: max-buffer-size from configuration should be use in TransientValueData during
import
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/DocumentViewImporter.java
===================================================================
---
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/DocumentViewImporter.java 2010-06-30
12:18:49 UTC (rev 2725)
+++
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/DocumentViewImporter.java 2010-06-30
13:23:12 UTC (rev 2726)
@@ -53,7 +53,9 @@
import org.exoplatform.services.log.Log;
import org.exoplatform.services.security.ConversationState;
+import java.io.ByteArrayInputStream;
import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -421,14 +423,23 @@
{
try
{
+ InputStream vStream = new
ByteArrayInputStream(Base64.decode(propertiesMap.get(propName)));
+ TransientValueData binaryValue =
+ new TransientValueData(0, vStream, valueFactory.getFileCleaner(),
valueFactory.getMaxBufferSize(), null,
+ true);
+ binaryValue.getAsStream().close();
+
newProperty =
- TransientPropertyData.createPropertyData(getParent(), propName,
PropertyType.BINARY, false,
- new TransientValueData(0, Base64.decode(propertiesMap.get(propName))));
+ TransientPropertyData.createPropertyData(getParent(), propName,
PropertyType.BINARY, false, binaryValue);
}
catch (DecodingException e)
{
throw new RepositoryException(e);
}
+ catch (IOException e)
+ {
+ throw new RepositoryException(e);
+ }
return newProperty;
}