jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r124974 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java
Date Wed, 12 Jan 2005 16:52:00 GMT
Author: stefan
Date: Wed Jan 12 08:51:54 2005
New Revision: 124974

URL: http://svn.apache.org/viewcvs?view=rev&rev=124974
Log:
inputstreams were not closed while storing blobs
Modified:
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java
Url: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java?view=diff&rev=124974&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java&r1=124973&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java&r2=124974
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java
Wed Jan 12 08:51:54 2005
@@ -261,7 +261,18 @@
                 // special handling required for binary value:
                 // spool binary value to file in blob store
                 BLOBFileValue blobVal = (BLOBFileValue) val.internalValue();
-                String blobId = blobStore.put((PropertyId) state.getId(), i, blobVal.getStream(),
blobVal.getLength());
+                InputStream in = blobVal.getStream();
+                String blobId;
+                try {
+                    blobId = blobStore.put((PropertyId) state.getId(), i, in,
+                            blobVal.getLength());
+                } finally {
+                    try {
+                        in.close();
+                    } catch (IOException e) {
+                        // ignore
+                    }
+                }
                 // store id of blob as property value
                 out.writeUTF(blobId);   // value
                 // replace value instance with value

Mime
View raw message