incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r760811 - /incubator/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceResolver2.java
Date Wed, 01 Apr 2009 08:09:18 GMT
Author: cziegeler
Date: Wed Apr  1 08:09:17 2009
New Revision: 760811

URL: http://svn.apache.org/viewvc?rev=760811&view=rev
Log:
SLING-906 : Remove query string before namespace mangeling and append it afterwards.

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=760811&r1=760810&r2=760811&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
Wed Apr  1 08:09:17 2009
@@ -748,14 +748,20 @@
 
     private String mangleNamespaces(String absPath) {
         if (factory.isMangleNamespacePrefixes() && absPath.contains(MANGLE_NAMESPACE_OUT_SUFFIX))
{
+            final int queryPos = absPath.indexOf('?');
+            final String path = (queryPos == -1 ? absPath : absPath.substring(0, queryPos));
+
             Pattern p = Pattern.compile(MANGLE_NAMESPACE_OUT);
-            Matcher m = p.matcher(absPath);
+            Matcher m = p.matcher(path);
             StringBuffer buf = new StringBuffer();
             while (m.find()) {
                 String replacement = MANGLE_NAMESPACE_IN_PREFIX + m.group(1) + MANGLE_NAMESPACE_IN_SUFFIX;
                 m.appendReplacement(buf, replacement);
             }
             m.appendTail(buf);
+            if ( queryPos != -1 ) {
+                buf.append(absPath.substring(queryPos));
+            }
             absPath = buf.toString();
         }
 



Mime
View raw message