jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r927036 - in /jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex: BinaryPart.java BinaryPartSource.java QValueFactoryImpl.java RepositoryServiceImpl.java
Date Wed, 24 Mar 2010 12:34:16 GMT
Author: tripod
Date: Wed Mar 24 12:34:16 2010
New Revision: 927036

URL: http://svn.apache.org/viewvc?rev=927036&view=rev
Log:
JCR-2582 spi2dav: temp files are not clean up after batch submit

Modified:
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/BinaryPart.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/BinaryPartSource.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java
    jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/BinaryPart.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/BinaryPart.java?rev=927036&r1=927035&r2=927036&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/BinaryPart.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/BinaryPart.java
Wed Mar 24 12:34:16 2010
@@ -50,4 +50,11 @@ class BinaryPart extends FilePart {
             out.write(QUOTE_BYTES);
         }
     }
+
+    public void dispose() {
+        PartSource src = getSource();
+        if (src instanceof BinaryPartSource) {
+            ((BinaryPartSource) src).dispose();
+        }
+    }
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/BinaryPartSource.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/BinaryPartSource.java?rev=927036&r1=927035&r2=927036&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/BinaryPartSource.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/BinaryPartSource.java
Wed Mar 24 12:34:16 2010
@@ -53,4 +53,8 @@ public class BinaryPartSource implements
             throw new IOException(e.getMessage());
         }
     }
+
+    public void dispose() {
+        value.discard();
+    }
 }
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java?rev=927036&r1=927035&r2=927036&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/QValueFactoryImpl.java
Wed Mar 24 12:34:16 2010
@@ -316,10 +316,9 @@ class QValueFactoryImpl extends org.apac
             if (file != null) {
                 // this instance is backed by a temp file
                 file.delete();
-            } else if (buffer != null) {
-                // this instance is backed by an in-memory buffer
-                buffer = EMPTY_BYTE_ARRAY;
             }
+            file = null;
+            buffer = null;
         }
 
         //-----------------------------------------------< java.lang.Object >---

Modified: jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java?rev=927036&r1=927035&r2=927036&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi2dav/src/main/java/org/apache/jackrabbit/spi2davex/RepositoryServiceImpl.java
Wed Mar 24 12:34:16 2010
@@ -481,6 +481,14 @@ public class RepositoryServiceImpl exten
         private void dispose() {
             method = null;
             isConsumed = true;
+            // discard binary parts (JCR-2582)
+            if (parts != null) {
+                for (Part part : parts) {
+                    if (part instanceof BinaryPart) {
+                        ((BinaryPart) part).dispose();
+                    }
+                }
+            }
         }
 
         private void checkConsumed() {



Mime
View raw message