jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r753328 - /jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java
Date Fri, 13 Mar 2009 17:53:39 GMT
Author: angela
Date: Fri Mar 13 17:53:30 2009
New Revision: 753328

URL: http://svn.apache.org/viewvc?rev=753328&view=rev
Log:
JCR-2018 Jcr-Remoting: PathNotFoundException if item name ends with .json

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java?rev=753328&r1=753327&r2=753328&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/server/remoting/davex/JcrRemotingServlet.java
Fri Mar 13 17:53:30 2009
@@ -673,13 +673,18 @@
             if (locator instanceof WrappingLocator && ((WrappingLocator)locator).isJsonRequest)
{
                 // check if the .json extension has been correctly interpreted.
                 Session s = sessionImpl.getRepositorySession();
-                if (s.itemExists(((WrappingLocator)locator).loc.getRepositoryPath())) {
-                    // an item exists with the original calculated repo-path
-                    // -> assume that the repository item path ends with .json
-                    // or .depth.json. i.e. .json wasn't an extra extension
-                    // appended to request the json-serialization of the node.
-                    // -> change the flag in the WrappingLocator correspondingly.
-                    ((WrappingLocator) locator).isJsonRequest = false;
+                try {
+                    if (s.itemExists(((WrappingLocator)locator).loc.getRepositoryPath()))
{
+                        // an item exists with the original calculated repo-path
+                        // -> assume that the repository item path ends with .json
+                        // or .depth.json. i.e. .json wasn't an extra extension
+                        // appended to request the json-serialization of the node.
+                        // -> change the flag in the WrappingLocator correspondingly.
+                        ((WrappingLocator) locator).isJsonRequest = false;
+                    }
+                } catch (RepositoryException e) {
+                    // if the unmodified repository path isn't valid (e.g. /a/b[2].5.json)
+                    // -> ignore.
                 }
             }
             return super.getItem(sessionImpl, locator);



Mime
View raw message