jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r748486 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs: db/DatabaseFileSystem.java db/OracleFileSystem.java mem/MemoryFileSystem.java
Date Fri, 27 Feb 2009 11:02:04 GMT
Author: stefan
Date: Fri Feb 27 11:02:04 2009
New Revision: 748486

URL: http://svn.apache.org/viewvc?rev=748486&view=rev
Log:
avoid single byte writes

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DatabaseFileSystem.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DatabaseFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DatabaseFileSystem.java?rev=748486&r1=748485&r2=748486&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DatabaseFileSystem.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/DatabaseFileSystem.java
Fri Feb 27 11:02:04 2009
@@ -740,8 +740,14 @@
 
             return new FilterOutputStream(new FileOutputStream(tmpFile)) {
 
+                public void write(byte[] bytes, int off, int len) throws IOException {
+                    out.write(bytes, off, len);
+                }
+
                 public void close() throws IOException {
-                    super.close();
+                    out.flush();
+                    ((FileOutputStream) out).getFD().sync();
+                    out.close();
 
                     InputStream in = null;
                     try {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java?rev=748486&r1=748485&r2=748486&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/db/OracleFileSystem.java
Fri Feb 27 11:02:04 2009
@@ -361,8 +361,14 @@
 
             return new FilterOutputStream(new FileOutputStream(tmpFile)) {
 
+                public void write(byte[] bytes, int off, int len) throws IOException {
+                    out.write(bytes, off, len);
+                }
+
                 public void close() throws IOException {
-                    super.close();
+                    out.flush();
+                    ((FileOutputStream) out).getFD().sync();
+                    out.close();
 
                     InputStream in = null;
                     Blob blob = null;

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java?rev=748486&r1=748485&r2=748486&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
Fri Feb 27 11:02:04 2009
@@ -148,6 +148,10 @@
         final MemoryFile file = new MemoryFile();
         entries.put(filePath, file);
         return new FilterOutputStream(new ByteArrayOutputStream()) {
+            public void write(byte[] bytes, int off, int len) throws IOException {
+                out.write(bytes, off, len);
+            }
+
             public void close() throws IOException {
                 out.close();
                 file.setData(((ByteArrayOutputStream) out).toByteArray());



Mime
View raw message