You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2009/10/07 10:45:46 UTC
svn commit: r822623 -
/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java
Author: cziegeler
Date: Wed Oct 7 08:45:46 2009
New Revision: 822623
URL: http://svn.apache.org/viewvc?rev=822623&view=rev
Log:
SLING-864 : Parse path info for NonExistingResource - apply patch from Felix
Modified:
sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java
Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java?rev=822623&r1=822622&r2=822623&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java Wed Oct 7 08:45:46 2009
@@ -231,10 +231,19 @@
// if no resource has been found, use a NonExistingResource
if (res == null) {
+ final String resourcePath = ensureAbsPath(realPathList[0]);
log.debug(
"resolve: Path {} does not resolve, returning NonExistingResource at {}",
- absPath, realPathList[0]);
- res = new NonExistingResource(this, ensureAbsPath(realPathList[0]));
+ absPath, resourcePath);
+
+ res = new NonExistingResource(this, resourcePath);
+ // SLING-864: if the path contains a dot we assume this to be
+ // the start for any selectors, extension, suffix, which may be
+ // used for further request processing.
+ int index = resourcePath.indexOf('.');
+ if (index != -1) {
+ res.getResourceMetadata().setResolutionPathInfo(resourcePath.substring(index));
+ }
} else {
log.debug("resolve: Path {} resolves to Resource {}", absPath, res);
}