jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1225171 - in /jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit: ItemImpl.java Path.java PropertyImpl.java state/ChangeTree.java
Date Wed, 28 Dec 2011 12:41:36 GMT
Author: mduerig
Date: Wed Dec 28 12:41:36 2011
New Revision: 1225171

URL: http://svn.apache.org/viewvc?rev=1225171&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- refactor

Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/ItemImpl.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/Path.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/PropertyImpl.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/ItemImpl.java?rev=1225171&r1=1225170&r2=1225171&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/ItemImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/ItemImpl.java
Wed Dec 28 12:41:36 2011
@@ -44,7 +44,7 @@ abstract class ItemImpl implements Item 
 
     @Override
     public String getPath() throws RepositoryException {
-        return path.getPath();
+        return path.getJcrPath();
     }
 
     @Override

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/Path.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/Path.java?rev=1225171&r1=1225170&r2=1225171&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/Path.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/Path.java
Wed Dec 28 12:41:36 2011
@@ -23,11 +23,11 @@ import org.apache.jackrabbit.mk.util.Pat
 
 public final class Path {
     private final String workspace;
-    private final String path;
+    private final String jcrPath;
 
-    private Path(String workspace, String path) {
+    private Path(String workspace, String jcrPath) {
         this.workspace = workspace;
-        this.path = path;
+        this.jcrPath = jcrPath;
     }
 
     public static Path create(String workspace) {
@@ -54,16 +54,16 @@ public final class Path {
         return workspace;
     }
 
-    public String getPath() {
-        return path;
+    public String getJcrPath() {
+        return jcrPath;
     }
 
     public String getMkPath() {
-        return buildMkPath(workspace, path);
+        return buildMkPath(workspace, jcrPath);
     }
 
     public boolean isRoot() {
-        return "/".equals(path);
+        return "/".equals(jcrPath);
     }
 
     public Path concat(String relPath) {
@@ -74,7 +74,7 @@ public final class Path {
             throw new IllegalArgumentException("Not a relative path: " + relPath);
         }
 
-        return new Path(workspace, PathUtils.concat(path, relPath));
+        return new Path(workspace, PathUtils.concat(jcrPath, relPath));
     }
 
     public Path getAncestor(int depth) {
@@ -84,37 +84,37 @@ public final class Path {
 
         int pos = 0;
         for (int k = 0; k < depth && pos >= 0; k++) {
-            pos = PathUtils.getNextSlash(path, pos + 1);
+            pos = PathUtils.getNextSlash(jcrPath, pos + 1);
         }
 
         return pos > 0
-            ? new Path(workspace, path.substring(0, pos))
+            ? new Path(workspace, jcrPath.substring(0, pos))
             : null;
     }
 
     public Path getParent() {
         return isRoot()
             ? null
-            : new Path(workspace, PathUtils.getParentPath(path));
+            : new Path(workspace, PathUtils.getParentPath(jcrPath));
     }
 
     public String getName() {
         return isRoot()
             ? ""
-            : PathUtils.getName(path);
+            : PathUtils.getName(jcrPath);
     }
 
     public Iterable<String> getNames() {
-        return PathUtils.elements(path);
+        return PathUtils.elements(jcrPath);
     }
 
     public int getDepth() {
-        return PathUtils.getDepth(path);
+        return PathUtils.getDepth(jcrPath);
     }
 
     @Override
     public String toString() {
-        return workspace + ':' + path;
+        return workspace + ':' + jcrPath;
     }
 
     @Override
@@ -128,7 +128,7 @@ public final class Path {
 
         Path otherPath = (Path) other;
 
-        return (path == null ? otherPath.path == null : path.equals(otherPath.path))
+        return (jcrPath == null ? otherPath.jcrPath == null : jcrPath.equals(otherPath.jcrPath))
             && (workspace == null ? otherPath.workspace == null : workspace.equals(otherPath.workspace));
 
     }
@@ -136,7 +136,7 @@ public final class Path {
     @Override
     public int hashCode() {
         return 31 * (workspace == null ? 0 : workspace.hashCode())
-                  + (path == null ? 0 : path.hashCode());
+                  + (jcrPath == null ? 0 : jcrPath.hashCode());
     }
 
     //------------------------------------------< private >---

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/PropertyImpl.java?rev=1225171&r1=1225170&r2=1225171&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/PropertyImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/PropertyImpl.java
Wed Dec 28 12:41:36 2011
@@ -337,7 +337,7 @@ public class PropertyImpl extends ItemIm
         JsonObject node = FullJsonParser.parseObject(new UnescapingJsonTokenizer(nodeJson));
         JsonValue jsonValue = node.value().get(name);
         if (jsonValue == null) {
-            throw new PathNotFoundException(path.getPath());
+            throw new PathNotFoundException(path.getJcrPath());
         }
         else {
             return jsonValue;

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java?rev=1225171&r1=1225170&r2=1225171&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
Wed Dec 28 12:41:36 2011
@@ -95,7 +95,7 @@ public class ChangeTree {
     public NodeDelta getNode(Path path) throws PathNotFoundException {
         NodeDelta delta = getNodeOrNull(path);
         if (delta == null) {
-            throw new PathNotFoundException(path.getPath());
+            throw new PathNotFoundException(path.getJcrPath());
         }
 
         return delta;
@@ -416,12 +416,12 @@ public class ChangeTree {
             }
 
             if (nodeExists(destination)) {
-                throw new ItemExistsException(destination.getPath());
+                throw new ItemExistsException(destination.getJcrPath());
             }
 
             Path destParentPath = destination.getParent();
             if (!nodeExists(destParentPath)) {
-                throw new PathNotFoundException(destParentPath.getPath());
+                throw new PathNotFoundException(destParentPath.getJcrPath());
             }
 
             if (source.isTransient()) {



Mime
View raw message