jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1143361 - in /jackrabbit/sandbox/spi2microkernel/src: main/java/org/apache/jackrabbit/spi2microkernel/ main/java/org/apache/jackrabbit/spi2microkernel/util/ test/java/org/apache/jackrabbit/spi2microkernel/
Date Wed, 06 Jul 2011 12:01:16 GMT
Author: mduerig
Date: Wed Jul  6 12:01:16 2011
New Revision: 1143361

URL: http://svn.apache.org/viewvc?rev=1143361&view=rev
Log:
spi2microkernel prototype (WIP)
fixes in path handling

Modified:
    jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
    jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Paths.java
    jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java?rev=1143361&r1=1143360&r2=1143361&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Wed Jul  6 12:01:16 2011
@@ -371,6 +371,11 @@ public class RepositoryServiceImpl exten
         return subscription(subscription).getEvents(timeout);
     }
 
+    @Override
+    public void dispose(Subscription subscription) throws RepositoryException {
+        super.dispose(subscription);    // fixme implement dispose
+    }
+
     //------------------------------------------< private >---
 
     private static SubscriptionImpl subscription(Subscription subscription) throws RepositoryException
{

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Paths.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Paths.java?rev=1143361&r1=1143360&r2=1143361&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Paths.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/util/Paths.java
Wed Jul  6 12:01:16 2011
@@ -70,7 +70,7 @@ public final class Paths {
             parent = PathUtils.getParentPath(parent);
         }
 
-        if ("/".equals(parent)) {
+        if (PathUtils.denotesRoot(parent)) {
             elements.addFirst(PATH_FACTORY.getRootElement());
         }
 
@@ -83,7 +83,7 @@ public final class Paths {
     }
 
     public static String pathToString(String wspName, Path path) throws RepositoryException
{
-        return cat('/' + getWorkspaceName(wspName), translateQPath(path));
+        return PathUtils.concat('/' + getWorkspaceName(wspName), translateQPath(path));
     }
 
     public static String getWorkspaceName(String name) throws NoSuchWorkspaceException {
@@ -108,20 +108,10 @@ public final class Paths {
         return nameSpaceURI.replace('\\', '/');
     }
 
-    private static String cat(String absPath, String relPath) {
-        if ("".equals(absPath)) {
-            return relPath;
-        }
-        if ("".equals(relPath)) {
-            return absPath;
-        }
-        return absPath + '/' + relPath;
-    }
-
     private static String translateQPath(Path path) throws RepositoryException {
         return path.denotesRoot()
             ? ""
-            : cat(translateQPath(path.getAncestor(1)), nameToString(path.getName()));
+            : PathUtils.concat(translateQPath(path.getAncestor(1)), nameToString(path.getName()));
     }
 
 }

Modified: jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java?rev=1143361&r1=1143360&r2=1143361&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
Wed Jul  6 12:01:16 2011
@@ -70,7 +70,7 @@ public class MicrokernelTest {
         try {
             String s2 = mk.getNodes("/test/", head);
             Assert.fail("Success with invalid path: " + s2);
-        } catch (Exception e) {
+        } catch (AssertionError e) {
             // expected
         }
     }



Mime
View raw message