sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r612062 - /incubator/sling/whiteboard/fmeschbe/resource/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResourceProvider.java
Date Tue, 15 Jan 2008 09:40:45 GMT
Author: fmeschbe
Date: Tue Jan 15 01:40:44 2008
New Revision: 612062

URL: http://svn.apache.org/viewvc?rev=612062&view=rev
Log:
Convert registered resource types to paths using the new helper
method in the PathSupport class.

Modified:
    incubator/sling/whiteboard/fmeschbe/resource/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResourceProvider.java

Modified: incubator/sling/whiteboard/fmeschbe/resource/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResourceProvider.java
URL: http://svn.apache.org/viewvc/incubator/sling/whiteboard/fmeschbe/resource/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResourceProvider.java?rev=612062&r1=612061&r2=612062&view=diff
==============================================================================
--- incubator/sling/whiteboard/fmeschbe/resource/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResourceProvider.java
(original)
+++ incubator/sling/whiteboard/fmeschbe/resource/sling/servlet-resolver/src/main/java/org/apache/sling/servlet/resolver/resource/ServletResourceProvider.java
Tue Jan 15 01:40:44 2008
@@ -35,6 +35,7 @@
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceProvider;
 import org.apache.sling.osgi.commons.OsgiUtil;
+import org.apache.sling.servlet.resolver.helper.PathSupport;
 import org.osgi.framework.ServiceReference;
 
 public class ServletResourceProvider implements ResourceProvider {
@@ -74,19 +75,28 @@
 
         List<String> pathList = new ArrayList<String>();
         for (String type : types) {
+            
+            // ensure namespace prefixes are converted to slashes
+            type = PathSupport.toPath(type);
+            
+            // make absolute if relative
             if (!type.startsWith("/")) {
                 type = servletRoot + type;
             }
+            
+            // ensure trailing slash for full path building
             if (!type.endsWith("/")) {
                 type += "/";
             }
 
+            // create paths with extensions
             if (extensions != null) {
                 for (String ext : extensions) {
                     pathList.add(type + ext);
                 }
             }
 
+            // create paths with method names
             if (methods != null) {
                 for (String method : methods) {
                     pathList.add(type + method);



Mime
View raw message