jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1338245 - in /jackrabbit/oak/trunk: oak-it/jcr/pom.xml oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Date Mon, 14 May 2012 15:13:06 GMT
Author: reschke
Date: Mon May 14 15:13:06 2012
New Revision: 1338245

URL: http://svn.apache.org/viewvc?rev=1338245&view=rev
Log:
OAK-23: implement Session.getItem(identifier) (WIP); update test exclusions

Modified:
    jackrabbit/oak/trunk/oak-it/jcr/pom.xml
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java

Modified: jackrabbit/oak/trunk/oak-it/jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/jcr/pom.xml?rev=1338245&r1=1338244&r2=1338245&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-it/jcr/pom.xml Mon May 14 15:13:06 2012
@@ -46,7 +46,6 @@
               <value>
 org.apache.jackrabbit.test.api.NodeReadMethodsTest#testGetUUID
 org.apache.jackrabbit.test.api.SessionReadMethodsTest#testGetNodeByUUID
-org.apache.jackrabbit.test.api.PathTest#testGetItem
 org.apache.jackrabbit.test.api.AddNodeTest#testConstraintViolation
 org.apache.jackrabbit.test.api.AddNodeTest#testRepositoryException
 org.apache.jackrabbit.test.api.ReferencesTest#testNonReferenceable

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=1338245&r1=1338244&r2=1338245&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
Mon May 14 15:13:06 2012
@@ -25,8 +25,10 @@ import org.slf4j.LoggerFactory;
 import org.xml.sax.ContentHandler;
 
 import javax.jcr.Credentials;
+import javax.jcr.Item;
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -76,6 +78,16 @@ public class SessionImpl extends Abstrac
     }
 
     @Override
+    public Item getItem(String absPath) throws PathNotFoundException, RepositoryException
{
+        if (absPath.startsWith("[") && absPath.endsWith("]")) {
+            // TODO OAK-23 - maybe this code should be added in AbstractSession
+            return getNodeByIdentifier(absPath.substring(1, absPath.length() - 1));
+        } else {
+            return super.getItem(absPath);
+        }
+    }
+    
+    @Override
     public Workspace getWorkspace() {
         return dlg.getWorkspace();
     }



Mime
View raw message