jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r148895 - in incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: fs/local state/mem state/obj state/xml
Date Fri, 28 Jan 2005 15:53:26 GMT
Author: tripod
Date: Fri Jan 28 07:53:24 2005
New Revision: 148895

URL: http://svn.apache.org/viewcvs?view=rev&rev=148895
Log:
- oops. readding setPath()
Modified:
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/LocalFileSystem.java
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/LocalFileSystem.java
Url: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/LocalFileSystem.java?view=diff&rev=148895&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/LocalFileSystem.java&r1=148894&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/LocalFileSystem.java&r2=148895
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/LocalFileSystem.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/fs/local/LocalFileSystem.java
Fri Jan 28 07:53:24 2005
@@ -30,7 +30,6 @@
 
     private static Logger log = Logger.getLogger(LocalFileSystem.class);
 
-    private String rootPath;
     private File root;
 
     /**
@@ -40,15 +39,22 @@
     }
 
     public String getPath() {
-        return rootPath;
+        return root == null ? null : root.getPath();
     }
 
-    public void setPath(String path) {
-        rootPath = osPath(path);
+    /**
+     * Sets the path to the root directory of this local filesystem. please note
+     * that this method can be called via reflection during initialization and
+     * must not be altered.
+     *
+     * @param rootPath the path to the root directory
+     */
+    public void setPath(String rootPath) {
+        setRoot(new File(osPath(rootPath)));
     }
 
-    public void setPath(File path) {
-        rootPath = path.getAbsolutePath();
+    public void setRoot(File root) {
+        this.root = root;
     }
 
     private String osPath(String genericPath) {
@@ -65,8 +71,7 @@
         }
         if (obj instanceof LocalFileSystem) {
             LocalFileSystem other = (LocalFileSystem) obj;
-            return (root == null ? other.root == null : root.equals(other.root))
-                    && (rootPath == null ? other.rootPath == null : rootPath.equals(other.rootPath));
+            return (root == null ? other.root == null : root.equals(other.root));
         }
         return false;
     }
@@ -76,12 +81,11 @@
      * @see FileSystem#init()
      */
     public void init() throws FileSystemException {
-        if (rootPath == null) {
-            String msg = "path not set";
+        if (root == null) {
+            String msg = "root directory not set";
             log.error(msg);
             throw new FileSystemException(msg);
         }
-        root = new File(rootPath);
 
         if (root.exists()) {
             if (!root.isDirectory()) {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java
Url: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java?view=diff&rev=148895&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java&r1=148894&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java&r2=148895
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/mem/InMemPersistenceManager.java
Fri Jan 28 07:53:24 2005
@@ -324,7 +324,7 @@
          * of the workspace home directory
          */
         LocalFileSystem blobFS = new LocalFileSystem();
-        blobFS.setPath(new File(context.getHomeDir(), "blobs"));
+        blobFS.setRoot(new File(context.getHomeDir(), "blobs"));
         blobFS.init();
         this.blobFS = blobFS;
 

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=148895&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java&r1=148894&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java&r2=148895
==============================================================================
--- 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
Fri Jan 28 07:53:24 2005
@@ -434,7 +434,7 @@
          * of the workspace home directory
          */
         LocalFileSystem blobFS = new LocalFileSystem();
-        blobFS.setPath(new File(context.getHomeDir(), "blobs"));
+        blobFS.setRoot(new File(context.getHomeDir(), "blobs"));
         blobFS.init();
         this.blobFS = blobFS;
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
Url: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java?view=diff&rev=148895&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java&r1=148894&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java&r2=148895
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/xml/XMLPersistenceManager.java
Fri Jan 28 07:53:24 2005
@@ -355,7 +355,7 @@
          * todo make blob store configurable
          */
         LocalFileSystem blobFS = new LocalFileSystem();
-        blobFS.setPath(new File(context.getHomeDir(), "blobs"));
+        blobFS.setRoot(new File(context.getHomeDir(), "blobs"));
         blobFS.init();
         blobStore = blobFS;
 

Mime
View raw message