incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1130315 - in /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper: MapEntries.java MapEntry.java
Date Wed, 01 Jun 2011 21:49:07 GMT
Author: fmeschbe
Date: Wed Jun  1 21:49:07 2011
New Revision: 1130315

URL: http://svn.apache.org/viewvc?rev=1130315&view=rev
Log:
SLING-2092 If the map entry for a mapping is for any scheme and any host:port, we just remove
it from the target mapping entry.

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntry.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java?rev=1130315&r1=1130314&r2=1130315&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntries.java
Wed Jun  1 21:49:07 2011
@@ -55,7 +55,7 @@ public class MapEntries implements Event
 
     public static final String DEFAULT_MAP_ROOT = "/etc/map";
 
-    private static final String ANY_SCHEME_HOST = "[^/]+/[^/]+";
+    static final String ANY_SCHEME_HOST = "[^/]+/[^/]+";
 
     /** default log */
     private final Logger log = LoggerFactory.getLogger(getClass());

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntry.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntry.java?rev=1130315&r1=1130314&r2=1130315&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntry.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/MapEntry.java
Wed Jun  1 21:49:07 2011
@@ -165,6 +165,11 @@ public class MapEntry implements Compara
                 url = url.substring(0, url.length()-1);
             }
 
+            // check whether the url is for ANY_SCHEME_HOST
+            if (url.startsWith(MapEntries.ANY_SCHEME_HOST)) {
+                url = url.substring(MapEntries.ANY_SCHEME_HOST.length());
+            }
+
             String[] internalRedirect = props.get(
                 JcrResourceResolver.PROP_REDIRECT_INTERNAL, String[].class);
             if (internalRedirect != null) {



Mime
View raw message