jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r677939 - /jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java
Date Fri, 18 Jul 2008 15:24:37 GMT
Author: angela
Date: Fri Jul 18 08:24:37 2008
New Revision: 677939

URL: http://svn.apache.org/viewvc?rev=677939&view=rev
Log:
JCR-1319: NullPointerException when accessing the SimpleWebdavServlet at the prefix path

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java?rev=677939&r1=677938&r2=677939&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/simple/ResourceFactoryImpl.java
Fri Jul 18 08:24:37 2008
@@ -137,13 +137,16 @@
             throws RepositoryException {
         Node node = null;
         try {
-            Item item = ((JcrDavSession)sessionImpl).getRepositorySession().getItem(locator.getRepositoryPath());
-            if (item instanceof Node) {
-                node = (Node)item;
-            } // else: item is a property -> return null
+            String repoPath = locator.getRepositoryPath();
+            if (repoPath != null) {
+                Session session = ((JcrDavSession)sessionImpl).getRepositorySession();
+                Item item = session.getItem(repoPath);
+                if (item instanceof Node) {
+                    node = (Node)item;
+                } // else: item is a property -> return null
+            }
         } catch (PathNotFoundException e) {
-            // item does not exist (yet) -> create null-resource
-            node = null;
+            // item does not exist (yet). return null -> create null-resource
         }
         return node;
     }
@@ -153,7 +156,7 @@
      *
      * @param locator
      * @param session
-     * @param request
+     * @param isCollection
      * @return
      * @throws DavException
      */
@@ -178,10 +181,11 @@
      * supports the versioning option different resources are created for
      * version, versionhistory and common nodes.
      *
+     * @param node
      * @param locator
-     * @param sessionImpl
-     * @return DavResource representing a repository item.
-     * @throws RepositoryException if {@link javax.jcr.Session#getItem(String)} fails.
+     * @param session
+     * @return
+     * @throws DavException
      */
     private DavResource createResource(Node node, DavResourceLocator locator,
                                        DavSession session) throws DavException {



Mime
View raw message