jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1039422 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core: data/db/DbDataStore.java util/TrackingInputStream.java
Date Fri, 26 Nov 2010 15:40:42 GMT
Author: jukka
Date: Fri Nov 26 15:40:41 2010
New Revision: 1039422

URL: http://svn.apache.org/viewvc?rev=1039422&view=rev
Log:
JCR-2823: Replace TrackingInpuStream with Commons IO

Removed:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/util/TrackingInputStream.java
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java?rev=1039422&r1=1039421&r2=1039422&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/db/DbDataStore.java
Fri Nov 26 15:40:41 2010
@@ -16,11 +16,11 @@
  */
 package org.apache.jackrabbit.core.data.db;
 
+import org.apache.commons.io.input.CountingInputStream;
 import org.apache.jackrabbit.core.data.DataIdentifier;
 import org.apache.jackrabbit.core.data.DataRecord;
 import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.data.DataStoreException;
-import org.apache.jackrabbit.core.util.TrackingInputStream;
 import org.apache.jackrabbit.core.util.db.CheckSchemaOperation;
 import org.apache.jackrabbit.core.util.db.ConnectionFactory;
 import org.apache.jackrabbit.core.util.db.ConnectionHelper;
@@ -343,7 +343,7 @@ public class DbDataStore implements Data
             temporaryInUse.add(tempId);
             MessageDigest digest = getDigest();
             DigestInputStream dIn = new DigestInputStream(stream, digest);
-            TrackingInputStream in = new TrackingInputStream(dIn);
+            CountingInputStream in = new CountingInputStream(dIn);
             StreamWrapper wrapper;
             if (STORE_SIZE_MINUS_ONE.equals(storeStream)) {
                 wrapper = new StreamWrapper(in, -1);
@@ -360,7 +360,7 @@ public class DbDataStore implements Data
             // UPDATE DATASTORE SET DATA=? WHERE ID=?
             conHelper.exec(updateDataSQL, new Object[]{wrapper, tempId});
             now = System.currentTimeMillis();
-            long length = in.getPosition();
+            long length = in.getByteCount();
             DataIdentifier identifier = new DataIdentifier(digest.digest());
             usesIdentifier(identifier);
             id = identifier.toString();



Mime
View raw message