[exo-jcr-commits] exo-jcr SVN: r2282 - jcr/trunk/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 08:04:22 EDT 2010
Author: tolusha
Date: 2010-04-15 08:04:21 -0400 (Thu, 15 Apr 2010)
New Revision: 2282
Modified:
jcr/trunk/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/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java
===================================================================
--- jcr/trunk/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)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/StreamPersistedValueData.java 2010-04-15 12:04:21 UTC (rev 2282)
@@ -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