jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1330407 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: ItemImpl.java SessionContext.java SessionImpl.java
Date Wed, 25 Apr 2012 16:43:13 GMT
Author: reschke
Date: Wed Apr 25 16:43:13 2012
New Revision: 1330407

URL: http://svn.apache.org/viewvc?rev=1330407&view=rev
Log:
OAK-61: move path conversion utilities to SessionContext

Modified:
    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/SessionContext.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java

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=1330407&r1=1330406&r2=1330407&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
Wed Apr 25 16:43:13 2012
@@ -134,15 +134,10 @@ abstract class ItemImpl implements Item 
 
     
     String toOakPath(String jcrPath) throws RepositoryException {
-        try {
-            return Paths.toOakPath(jcrPath, sessionContext.getNameMapper());
-        }
-        catch (IllegalArgumentException ex) {
-            throw new RepositoryException(ex);
-        }
+        return sessionContext.toOakPath(jcrPath);
     }
 
     String toJcrPath(String oakPath) {
-        return Paths.toJcrPath(oakPath, sessionContext.getNameMapper());
+        return sessionContext.toJcrPath(oakPath);
     }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java?rev=1330407&r1=1330406&r2=1330407&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
Wed Apr 25 16:43:13 2012
@@ -43,4 +43,6 @@ public interface SessionContext<T extend
     VersionManager getVersionManager() throws RepositoryException;
     Root getBranch();
     Tree getContentTree(NodeImpl node);
+    String toOakPath(String jcrPath) throws RepositoryException;
+    String toJcrPath(String oakPath);
 }

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=1330407&r1=1330406&r2=1330407&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
Wed Apr 25 16:43:13 2012
@@ -527,5 +527,19 @@ public class SessionImpl extends Abstrac
         public Tree getContentTree(NodeImpl node) {
             return root.getTree(node.path());
         }
+
+        @Override
+        public String toOakPath(String jcrPath) throws RepositoryException {
+            try {
+                return Paths.toOakPath(jcrPath, sessionContext.getNameMapper());
+            } catch (IllegalArgumentException ex) {
+                throw new RepositoryException(ex);
+            }
+        }
+
+        @Override
+        public String toJcrPath(String oakPath) {
+            return Paths.toJcrPath(oakPath, sessionContext.getNameMapper());
+        }
     }
 }
\ No newline at end of file



Mime
View raw message