You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2009/06/12 16:56:57 UTC

svn commit: r784146 - /incubator/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java

Author: fmeschbe
Date: Fri Jun 12 14:56:57 2009
New Revision: 784146

URL: http://svn.apache.org/viewvc?rev=784146&view=rev
Log:
SLING-1005 Reappend resource path info after resolve the resource
and optional aliases.

Modified:
    incubator/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java

Modified: incubator/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java?rev=784146&r1=784145&r2=784146&view=diff
==============================================================================
--- incubator/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java (original)
+++ incubator/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java Fri Jun 12 14:56:57 2009
@@ -290,12 +290,11 @@
 
         }
 
-        String resolutionPathInfo;
         Resource res = resolveInternal(mappedPath);
         if (res != null) {
 
             // keep, what we might have cut off in internal resolution
-            resolutionPathInfo = res.getResourceMetadata().getResolutionPathInfo();
+            final String resolutionPathInfo = res.getResourceMetadata().getResolutionPathInfo();
 
             log.debug("map: Path maps to resource {} with path info {}", res,
                 resolutionPathInfo);
@@ -319,15 +318,17 @@
                 buf.append('/');
                 buf.append(names.removeLast());
             }
+            
+            // reappend the resolutionPathInfo
+            if (resolutionPathInfo != null) {
+                buf.append(resolutionPathInfo);
+            }
+            
+            // and then we have the mapped path to work on
             mappedPath = buf.toString();
 
             log.debug("map: Alias mapping resolves to path {}", mappedPath);
 
-        } else {
-
-            // we have no resource, hence no resolution path info
-            resolutionPathInfo = null;
-
         }
 
         boolean mappedPathIsUrl = false;
@@ -366,11 +367,6 @@
             mappedPath = resourcePath;
         }
 
-        // append resolution path info, which might have been cut off above
-        if (resolutionPathInfo != null) {
-            mappedPath = mappedPath.concat(resolutionPathInfo);
-        }
-
         if (mappedPathIsUrl) {
             // TODO: Consider mangling the path but not the scheme and
             // esp. the host:port part