jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marti...@apache.org
Subject svn commit: r882891 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
Date Sat, 21 Nov 2009 12:54:50 GMT
Author: martijnh
Date: Sat Nov 21 12:54:49 2009
New Revision: 882891

URL: http://svn.apache.org/viewvc?rev=882891&view=rev
Log:
JCR-2320 Real In-memory Repository

* Applied proposed patch

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java?rev=882891&r1=882890&r2=882891&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
Sat Nov 21 12:54:49 2009
@@ -23,6 +23,7 @@
 import org.apache.jackrabbit.core.fs.FileSystemPathUtil;
 import org.apache.jackrabbit.core.fs.FileSystemResource;
 import org.apache.jackrabbit.core.fs.local.LocalFileSystem;
+import org.apache.jackrabbit.core.fs.mem.MemoryFileSystem;
 import org.apache.jackrabbit.core.persistence.AbstractPersistenceManager;
 import org.apache.jackrabbit.core.persistence.PMContext;
 import org.apache.jackrabbit.core.persistence.util.BLOBStore;
@@ -290,14 +291,14 @@
 
         wspFS = context.getFileSystem();
 
-        /**
-         * store BLOB data in local file system in a sub directory
-         * of the workspace home directory
-         */
-        LocalFileSystem blobFS = new LocalFileSystem();
-        blobFS.setRoot(new File(context.getHomeDir(), "blobs"));
+        // Choose a FileSystem for the BlobStore based on whether data is persistent or not

+        if (persistent) {
+            blobFS = new LocalFileSystem();
+            ((LocalFileSystem) blobFS).setRoot(new File(context.getHomeDir(), "blobs"));
+        } else {
+            blobFS = new MemoryFileSystem();
+        }
         blobFS.init();
-        this.blobFS = blobFS;
         blobStore = new FileSystemBLOBStore(blobFS);
 
         if (persistent) {



Mime
View raw message