[exo-jcr-commits] exo-jcr SVN: r2281 - jcr/branches/1.14.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Apr 15 07:52:16 EDT 2010
Author: tolusha
Date: 2010-04-15 07:52:15 -0400 (Thu, 15 Apr 2010)
New Revision: 2281
Modified:
jcr/branches/1.14.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java
Log:
EXOJCR-667: acquire spoolFile in StreamPersistedValueData
Modified: jcr/branches/1.14.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java
===================================================================
--- jcr/branches/1.14.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java 2010-04-15 08:45:40 UTC (rev 2280)
+++ jcr/branches/1.14.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java 2010-04-15 11:52:15 UTC (rev 2281)
@@ -19,6 +19,7 @@
package org.exoplatform.services.jcr.impl.dataflow.persistent;
import org.exoplatform.services.jcr.impl.dataflow.TransientValueData;
+import org.exoplatform.services.jcr.impl.util.io.SpoolFile;
import org.exoplatform.services.jcr.impl.util.io.SwapFile;
import java.io.File;
@@ -58,8 +59,9 @@
*
* @param orderNumber int
* @param tempFile File
+ * @throws FileNotFoundException
*/
- public StreamPersistedValueData(int orderNumber, File tempFile)
+ public StreamPersistedValueData(int orderNumber, File tempFile) throws FileNotFoundException
{
this(orderNumber, tempFile, null);
}
@@ -87,12 +89,18 @@
*
* @param orderNumber int
* @param tempFile File
+ * @throws FileNotFoundException
*/
- public StreamPersistedValueData(int orderNumber, File tempFile, File destFile)
+ public StreamPersistedValueData(int orderNumber, File tempFile, File destFile) throws FileNotFoundException
{
super(orderNumber, destFile);
this.tempFile = tempFile;
this.stream = null;
+
+ if (tempFile != null && tempFile instanceof SpoolFile)
+ {
+ ((SpoolFile)tempFile).acquire(this);
+ }
}
/**
@@ -224,6 +232,11 @@
{
((SwapFile)file).release(this);
}
+
+ if (tempFile != null && tempFile instanceof SpoolFile)
+ {
+ ((SpoolFile)tempFile).release(this);
+ }
}
finally
{
More information about the exo-jcr-commits
mailing list