jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1333804 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/ oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ oak-jcr/src/main/java/org/apache...
Date Fri, 04 May 2012 08:06:10 GMT
Author: angela
Date: Fri May  4 08:06:10 2012
New Revision: 1333804

URL: http://svn.apache.org/viewvc?rev=1333804&view=rev
Log:
OAK-61 : Implement JCR path handling

- use consistent method names in PathMapper (according to the NameMapper)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/PathMapper.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImplTest.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueFactoryImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java?rev=1333804&r1=1333803&r2=1333804&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImpl.java
Fri May  4 08:06:10 2012
@@ -51,7 +51,7 @@ public class NamePathMapperImpl implemen
 
     //---------------------------------------------------------< PathMapper >---
     @Override
-    public String toOakPath(String jcrPath) {
+    public String getOakPath(String jcrPath) {
         final List<String> elements = new ArrayList<String>();
 
         if ("/".equals(jcrPath)) {
@@ -133,7 +133,7 @@ public class NamePathMapperImpl implemen
     }
 
     @Override
-    public String toJcrPath(String oakPath) {
+    public String getJcrPath(String oakPath) {
         final List<String> elements = new ArrayList<String>();
 
         if ("/".equals(oakPath)) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/PathMapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/PathMapper.java?rev=1333804&r1=1333803&r2=1333804&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/PathMapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/namepath/PathMapper.java
Fri May  4 08:06:10 2012
@@ -21,8 +21,8 @@ package org.apache.jackrabbit.oak.namepa
  */
 public interface PathMapper {
 
-    String toOakPath(String jcrPath);
+    String getOakPath(String jcrPath);
 
-    String toJcrPath(String oakPath);
+    String getJcrPath(String oakPath);
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImplTest.java?rev=1333804&r1=1333803&r2=1333804&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/namepath/NamePathMapperImplTest.java
Fri May  4 08:06:10 2012
@@ -35,7 +35,7 @@ public class NamePathMapperImplTest {
     @Test
     public void testValidIdentifierPath() {
         String idPath = '[' + UUID.randomUUID().toString()+ ']';
-        npMapper.toOakPath(idPath);
+        npMapper.getOakPath(idPath);
     }
 
     @Test
@@ -46,7 +46,7 @@ public class NamePathMapperImplTest {
 
         for (String jcrPath : invalid) {
             try {
-                npMapper.toOakPath(jcrPath);
+                npMapper.getOakPath(jcrPath);
                 fail("Invalid identifier path");
             } catch (Exception e) {
                 // success
@@ -56,33 +56,33 @@ public class NamePathMapperImplTest {
 
     @Test
     public void testJcrToOak() {
-        assertEquals("/", npMapper.toOakPath("/"));
-        assertEquals("foo", npMapper.toOakPath("{}foo"));
-        assertEquals("/oak-foo:bar", npMapper.toOakPath("/foo:bar"));
+        assertEquals("/", npMapper.getOakPath("/"));
+        assertEquals("foo", npMapper.getOakPath("{}foo"));
+        assertEquals("/oak-foo:bar", npMapper.getOakPath("/foo:bar"));
         assertEquals("/oak-foo:bar/oak-quu:qux",
-                npMapper.toOakPath("/foo:bar/quu:qux"));
-        assertEquals("oak-foo:bar", npMapper.toOakPath("foo:bar"));
-        assertEquals("oak-nt:unstructured", npMapper.toOakPath(
+                npMapper.getOakPath("/foo:bar/quu:qux"));
+        assertEquals("oak-foo:bar", npMapper.getOakPath("foo:bar"));
+        assertEquals("oak-nt:unstructured", npMapper.getOakPath(
                 "{http://www.jcp.org/jcr/nt/1.0}unstructured"));
-        assertEquals("foobar/oak-jcr:content", npMapper.toOakPath(
+        assertEquals("foobar/oak-jcr:content", npMapper.getOakPath(
                 "foobar/{http://www.jcp.org/jcr/1.0}content"));
     }
 
     @Test
     public void testOakToJcr() {
-        assertEquals("/jcr-foo:bar", npMapper.toJcrPath("/foo:bar"));
+        assertEquals("/jcr-foo:bar", npMapper.getJcrPath("/foo:bar"));
         assertEquals("/jcr-foo:bar/jcr-quu:qux",
-                npMapper.toJcrPath("/foo:bar/quu:qux"));
-        assertEquals("jcr-foo:bar", npMapper.toJcrPath("foo:bar"));
+                npMapper.getJcrPath("/foo:bar/quu:qux"));
+        assertEquals("jcr-foo:bar", npMapper.getJcrPath("foo:bar"));
 
         try {
-            npMapper.toJcrPath("{http://www.jcp.org/jcr/nt/1.0}unstructured");
+            npMapper.getJcrPath("{http://www.jcp.org/jcr/nt/1.0}unstructured");
             fail("expanded name should not be accepted");
         } catch (IllegalStateException expected) {
         }
 
         try {
-            npMapper.toJcrPath("foobar/{http://www.jcp.org/jcr/1.0}content");
+            npMapper.getJcrPath("foobar/{http://www.jcp.org/jcr/1.0}content");
             fail("expanded name should not be accepted");
         } catch (IllegalStateException expected) {
         }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java?rev=1333804&r1=1333803&r2=1333804&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemImpl.java
Fri May  4 08:06:10 2012
@@ -175,7 +175,7 @@ abstract class ItemImpl extends Abstract
     
     String toOakPath(String jcrPath) throws RepositoryException {
         try {
-            return sessionDelegate.getNamePathMapper().toOakPath(jcrPath);
+            return sessionDelegate.getNamePathMapper().getOakPath(jcrPath);
         } catch (IllegalArgumentException ex) {
             // TODO we shouldn't have to catch this one
             throw new RepositoryException(ex);
@@ -187,6 +187,6 @@ abstract class ItemImpl extends Abstract
     }
 
     String toJcrPath(String oakPath) {
-        return sessionDelegate.getNamePathMapper().toJcrPath(oakPath);
+        return sessionDelegate.getNamePathMapper().getJcrPath(oakPath);
     }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java?rev=1333804&r1=1333803&r2=1333804&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
Fri May  4 08:06:10 2012
@@ -192,7 +192,7 @@ public class SessionDelegate {
         }
     }
 
-    //-------------------------------------------< SessionNamespaceResolver >---
+    //--------------------------------------------------< SessionNameMapper >---
 
     private class SessionNameMapper extends AbstractNameMapper {
 
@@ -228,5 +228,4 @@ public class SessionDelegate {
             }
         }
     }
-
 }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java?rev=1333804&r1=1333803&r2=1333804&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Fri May  4 08:06:10 2012
@@ -287,7 +287,7 @@ public class SessionImpl extends Abstrac
 
     private String toOakPath(String jcrPath) throws RepositoryException {
         try {
-            return dlg.getNamePathMapper().toOakPath(jcrPath);
+            return dlg.getNamePathMapper().getOakPath(jcrPath);
         } catch (IllegalArgumentException ex) {
             // TODO we shouldn't have to catch this one
             throw new RepositoryException(ex);

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java?rev=1333804&r1=1333803&r2=1333804&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
Fri May  4 08:06:10 2012
@@ -317,7 +317,7 @@ public class WorkspaceImpl implements Ja
 
     private String toOakPath(String jcrPath) throws RepositoryException {
         try {
-            return sessionDelegate.getNamePathMapper().toOakPath(jcrPath);
+            return sessionDelegate.getNamePathMapper().getOakPath(jcrPath);
         } catch (IllegalArgumentException ex) {
             // TODO we shouldn't have to catch this one
             throw new RepositoryException(ex);

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java?rev=1333804&r1=1333803&r2=1333804&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java
Fri May  4 08:06:10 2012
@@ -377,6 +377,6 @@ public class UserManagerImpl implements 
     }
 
     private String getInternalPath(Node node) throws RepositoryException {
-        return sessionDelegate.getNamePathMapper().toOakPath(node.getPath());
+        return sessionDelegate.getNamePathMapper().getOakPath(node.getPath());
     }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueFactoryImpl.java?rev=1333804&r1=1333803&r2=1333804&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueFactoryImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueFactoryImpl.java
Fri May  4 08:06:10 2012
@@ -151,7 +151,7 @@ public class ValueFactoryImpl implements
             if (type == PropertyType.NAME) {
                 cv = factory.createValue(namePathMapper.getOakName(value), type);
             } else if (type == PropertyType.PATH) {
-                String oakPath = namePathMapper.toOakPath(value);
+                String oakPath = namePathMapper.getOakPath(value);
                 cv = factory.createValue(oakPath, type);
             } else if (type == PropertyType.DATE) {
                 if (ISO8601.parse(value) == null) {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueImpl.java?rev=1333804&r1=1333803&r2=1333804&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/value/ValueImpl.java
Fri May  4 08:06:10 2012
@@ -152,7 +152,7 @@ class ValueImpl implements Value {
             case PropertyType.NAME :
                 return namePathMapper.getJcrName(value.toString());
             case PropertyType.PATH:
-                return namePathMapper.toJcrPath(value.toString());
+                return namePathMapper.getJcrPath(value.toString());
             case PropertyType.BINARY:
                 InputStream stream = getStream();
                 try {



Mime
View raw message