incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1038653 - in /sling/whiteboard/fmeschbe/milton: ./ src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/ src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/
Date Wed, 24 Nov 2010 15:50:17 GMT
Author: fmeschbe
Date: Wed Nov 24 15:50:16 2010
New Revision: 1038653

URL: http://svn.apache.org/viewvc?rev=1038653&view=rev
Log:
Add Sling-registered WebDAV servlet (untested)

Added:
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java
  (with props)
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavSlingServlet.java
  (with props)
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/JcrFileResource.java
      - copied, changed from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/JcrFileResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/JcrFolderResource.java
      - copied, changed from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/JcrFolderResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/PlatformFileResource.java
      - copied, changed from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/PlatformFileResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/PlatformFolderResource.java
      - copied, changed from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/PlatformFolderResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/ReadOnlyFileResource.java
      - copied, changed from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/ReadOnlyFileResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/ReadOnlyFolderResource.java
      - copied, changed from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/ReadOnlyFolderResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingCollectionResource.java
      - copied, changed from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingCollectionResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingDavResourceFactory.java
  (with props)
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingFileResource.java
      - copied, changed from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingFileResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingResource.java
      - copied, changed from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingResourceFactory.java
      - copied, changed from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResourceFactory.java
Removed:
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/JcrFileResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/JcrFolderResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/PlatformFileResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/PlatformFolderResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/ReadOnlyFileResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/ReadOnlyFolderResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingCollectionResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingFileResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResource.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResourceFactory.java
Modified:
    sling/whiteboard/fmeschbe/milton/pom.xml
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavServlet.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingAuthenticationHandler.java
    sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResponseHandler.java

Modified: sling/whiteboard/fmeschbe/milton/pom.xml
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/pom.xml?rev=1038653&r1=1038652&r2=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/pom.xml (original)
+++ sling/whiteboard/fmeschbe/milton/pom.xml Wed Nov 24 15:50:16 2010
@@ -62,7 +62,10 @@
                     <instructions>
                         <Import-Package>
                             !org.springframework.*,
-                            *;resolution:=optional
+                            !org.apache.xerces.*,
+                            !org.jaxen.*,
+                            !oracle.xml.*,
+                            *
                         </Import-Package>
                         <Embed-Transitive>true</Embed-Transitive>
                         <Embed-Dependency>
@@ -71,10 +74,7 @@
                             mime-util,
                             jdom,
                             commons-codec,
-                            commons-io,
-                            commons-fileupload,
-                            commons-beanutils,
-                            commons-collections
+                            commons-beanutils
                         </Embed-Dependency>
                     </instructions>
                 </configuration>

Added: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java?rev=1038653&view=auto
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java
(added)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java
Wed Nov 24 15:50:16 2010
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+
+import java.io.IOException;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.auth.core.AuthenticationSupport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.bradmcevoy.http.MiltonServlet;
+
+/**
+ * The <code>MiltonDavSlingServlet</code> is a servlet based on Milton WebDAV
+ * registering as a plain servlet to serve requests controlled by the Sling Main
+ * Servlet.
+ */
+public class AbstractMiltonDavServlet extends MiltonServlet {
+
+    /** default log */
+    private final Logger log = LoggerFactory.getLogger(getClass().getSimpleName());
+
+    @Override
+    public void init(ServletConfig config) throws ServletException {
+        super.init(config);
+    }
+
+    @Override
+    public void service(ServletRequest servletRequest,
+            ServletResponse servletResponse) throws ServletException,
+            IOException {
+        try {
+            if (log.isDebugEnabled()) {
+                log.debug("{} {}", new Object[] {
+                    ((HttpServletRequest) servletRequest).getMethod(),
+                    ((HttpServletRequest) servletRequest).getRequestURI() });
+            }
+            super.service(servletRequest, servletResponse);
+        } finally {
+            Object resolver = servletRequest.getAttribute(AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);
+            if (resolver instanceof ResourceResolver) {
+                ((ResourceResolver) resolver).close();
+            }
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    @Override
+    protected <T> T instantiate(String className) throws ServletException {
+        try {
+            Class c = getClass().getClassLoader().loadClass(className);
+            T rf = (T) c.newInstance();
+            return rf;
+        } catch (Throwable ex) {
+            throw new ServletException("Failed to instantiate: " + className,
+                ex);
+        }
+    }
+
+}
\ No newline at end of file

Propchange: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/AbstractMiltonDavServlet.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev Url

Modified: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavServlet.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavServlet.java?rev=1038653&r1=1038652&r2=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavServlet.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavServlet.java
Wed Nov 24 15:50:16 2010
@@ -22,10 +22,7 @@ import java.io.IOException;
 import java.net.URL;
 import java.util.Map;
 
-import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -38,22 +35,20 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.ReferenceCardinality;
 import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.sling.api.resource.LoginException;
-import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.auth.core.AuthenticationSupport;
 import org.apache.sling.auth.core.spi.AuthenticationHandler;
 import org.apache.sling.commons.mime.MimeTypeService;
+import org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources.SlingDavResourceFactory;
 import org.osgi.service.http.HttpContext;
 import org.osgi.service.http.HttpService;
 import org.osgi.service.http.NamespaceException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.bradmcevoy.http.MiltonServlet;
-
 @Component(metatype = true)
-@Properties( { @Property(name = "prefix", value = "/milton"),
+@Properties( { @Property(name = "prefix", value = "/dav"),
     @Property(name = "require.auth", boolValue = true) })
-public class MiltonDavServlet extends MiltonServlet {
+public class MiltonDavServlet extends AbstractMiltonDavServlet {
 
     /** default log */
     private final Logger log = LoggerFactory.getLogger(getClass().getSimpleName());
@@ -67,8 +62,6 @@ public class MiltonDavServlet extends Mi
     @Reference(policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.OPTIONAL_UNARY)
     private MimeTypeService mimeTypeService;
 
-    private SlingResourceFactory miltonResourceFactory;
-
     private String prefix;
 
     @SuppressWarnings("unused")
@@ -90,10 +83,10 @@ public class MiltonDavServlet extends Mi
         } else {
             prefix = "/milton";
         }
-        SlingResourceFactory.setPrefix(prefix);
+        SlingDavResourceFactory.setPrefix(prefix);
 
         java.util.Properties props = new java.util.Properties();
-        props.put("resource.factory.class", SlingResourceFactory.NAME);
+        props.put("resource.factory.class", SlingDavResourceFactory.NAME);
         props.put("authentication.handler.classes",
             SlingAuthenticationHandler.NAME);
         props.put("response.handler.class", SlingResponseHandler.NAME);
@@ -139,46 +132,4 @@ public class MiltonDavServlet extends Mi
             osgiHttpService.unregister(prefix);
         }
     }
-
-    @Override
-    public void init(ServletConfig config) throws ServletException {
-        super.init(config);
-    }
-
-    @Override
-    public void service(ServletRequest servletRequest,
-            ServletResponse servletResponse) throws ServletException,
-            IOException {
-        try {
-            if (log.isDebugEnabled()) {
-                log.debug("{} {}", new Object[] {
-                    ((HttpServletRequest) servletRequest).getMethod(),
-                    ((HttpServletRequest) servletRequest).getRequestURI() });
-            }
-            super.service(servletRequest, servletResponse);
-        } finally {
-            Object resolver = servletRequest.getAttribute(AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);
-            if (resolver instanceof ResourceResolver) {
-                ((ResourceResolver) resolver).close();
-            }
-        }
-    }
-
-    public SlingResourceFactory getMiltonResourceFactory() {
-        return miltonResourceFactory;
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
-    protected <T> T instantiate(String className) throws ServletException {
-        try {
-            Class c = getClass().getClassLoader().loadClass(className);
-            T rf = (T) c.newInstance();
-            return rf;
-        } catch (Throwable ex) {
-            throw new ServletException("Failed to instantiate: " + className,
-                ex);
-        }
-    }
-
 }
\ No newline at end of file

Added: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavSlingServlet.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavSlingServlet.java?rev=1038653&view=auto
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavSlingServlet.java
(added)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavSlingServlet.java
Wed Nov 24 15:50:16 2010
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+
+import javax.servlet.Servlet;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources.SlingResourceFactory;
+import org.osgi.framework.Constants;
+
+/**
+ * The <code>MiltonDavSlingServlet</code> is a servlet based on Milton WebDAV
+ * registering as a plain servlet to serve requests controlled by the Sling Main
+ * Servlet.
+ */
+@Component(metatype = true)
+@Service(value = Servlet.class)
+@Properties( {
+    @Property(name = Constants.SERVICE_DESCRIPTION, value = "Sling WebDAV Servlet"),
+    @Property(name = Constants.SERVICE_VENDOR, value = "The Apache Software Foundation"),
+    @Property(name = "sling.servlet.resourceTypes", value = "sling/servlet/default", propertyPrivate
= true),
+    @Property(name = "sling.servlet.methods", value = "*", propertyPrivate = true),
+    @Property(name = "resource.factory.class", value = SlingResourceFactory.NAME),
+    @Property(name = "authentication.handler.classes", value = SlingAuthenticationHandler.NAME),
+    @Property(name = "response.handler.class", value = SlingResponseHandler.NAME) })
+public class MiltonDavSlingServlet extends AbstractMiltonDavServlet {
+
+}
\ No newline at end of file

Propchange: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavSlingServlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/MiltonDavSlingServlet.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev Url

Modified: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingAuthenticationHandler.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingAuthenticationHandler.java?rev=1038653&r1=1038652&r2=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingAuthenticationHandler.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingAuthenticationHandler.java
Wed Nov 24 15:50:16 2010
@@ -27,11 +27,10 @@ import com.bradmcevoy.http.Resource;
 
 public class SlingAuthenticationHandler implements AuthenticationHandler {
 
-    static final String NAME = SlingAuthenticationHandler.class.getName();
+    static final String NAME = "org.apache.sling.whiteboard.fmeschbe.miltondav.impl.SlingAuthenticationHandler";
 
     public Object authenticate(Resource resource, Request request) {
-        return MiltonServlet.request().getAttribute(
-            AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);
+        return getResourceResolver();
     }
 
     public String getChallenge(Resource resource, Request request) {
@@ -43,7 +42,11 @@ public class SlingAuthenticationHandler 
     }
 
     public boolean supports(Resource r, Request request) {
+        return getResourceResolver() != null;
+    }
+
+    private Object getResourceResolver() {
         return MiltonServlet.request().getAttribute(
-            AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER) != null;
+            AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);
     }
 }

Modified: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResponseHandler.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResponseHandler.java?rev=1038653&r1=1038652&r2=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResponseHandler.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResponseHandler.java
Wed Nov 24 15:50:16 2010
@@ -30,7 +30,7 @@ import com.bradmcevoy.http.webdav.Resour
 
 public class SlingResponseHandler extends DefaultWebDavResponseHandler {
 
-    static final String NAME = SlingResponseHandler.class.getName();
+    static final String NAME = "org.apache.sling.whiteboard.fmeschbe.miltondav.impl.SlingResponseHandler";
 
     public SlingResponseHandler() {
         super(new AuthenticationService());

Copied: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/JcrFileResource.java
(from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/JcrFileResource.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/JcrFileResource.java?p2=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/JcrFileResource.java&p1=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/JcrFileResource.java&r1=988104&r2=1038653&rev=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/JcrFileResource.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/JcrFileResource.java
Wed Nov 24 15:50:16 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
 
 import java.util.Map;
 

Copied: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/JcrFolderResource.java
(from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/JcrFolderResource.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/JcrFolderResource.java?p2=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/JcrFolderResource.java&p1=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/JcrFolderResource.java&r1=988104&r2=1038653&rev=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/JcrFolderResource.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/JcrFolderResource.java
Wed Nov 24 15:50:16 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
 
 import java.io.IOException;
 import java.io.InputStream;

Copied: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/PlatformFileResource.java
(from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/PlatformFileResource.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/PlatformFileResource.java?p2=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/PlatformFileResource.java&p1=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/PlatformFileResource.java&r1=988104&r2=1038653&rev=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/PlatformFileResource.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/PlatformFileResource.java
Wed Nov 24 15:50:16 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
 
 import java.io.File;
 import java.io.FileInputStream;

Copied: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/PlatformFolderResource.java
(from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/PlatformFolderResource.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/PlatformFolderResource.java?p2=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/PlatformFolderResource.java&p1=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/PlatformFolderResource.java&r1=988104&r2=1038653&rev=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/PlatformFolderResource.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/PlatformFolderResource.java
Wed Nov 24 15:50:16 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
 
 import java.io.File;
 import java.io.FileOutputStream;

Copied: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/ReadOnlyFileResource.java
(from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/ReadOnlyFileResource.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/ReadOnlyFileResource.java?p2=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/ReadOnlyFileResource.java&p1=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/ReadOnlyFileResource.java&r1=988104&r2=1038653&rev=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/ReadOnlyFileResource.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/ReadOnlyFileResource.java
Wed Nov 24 15:50:16 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
 
 import java.util.Map;
 

Copied: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/ReadOnlyFolderResource.java
(from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/ReadOnlyFolderResource.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/ReadOnlyFolderResource.java?p2=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/ReadOnlyFolderResource.java&p1=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/ReadOnlyFolderResource.java&r1=988104&r2=1038653&rev=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/ReadOnlyFolderResource.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/ReadOnlyFolderResource.java
Wed Nov 24 15:50:16 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
 
 import java.io.IOException;
 import java.io.InputStream;

Copied: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingCollectionResource.java
(from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingCollectionResource.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingCollectionResource.java?p2=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingCollectionResource.java&p1=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingCollectionResource.java&r1=988104&r2=1038653&rev=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingCollectionResource.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingCollectionResource.java
Wed Nov 24 15:50:16 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
 
 import java.util.ArrayList;
 import java.util.Iterator;

Added: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingDavResourceFactory.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingDavResourceFactory.java?rev=1038653&view=auto
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingDavResourceFactory.java
(added)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingDavResourceFactory.java
Wed Nov 24 15:50:16 2010
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
+
+import com.bradmcevoy.http.Resource;
+
+public class SlingDavResourceFactory extends SlingResourceFactory {
+
+    public static final String NAME = "org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources.SlingDavResourceFactory";
+
+    private static String PREFIX;
+
+    public static void setPrefix(final String prefix) {
+        PREFIX = prefix;
+    }
+
+    public Resource getResource(final String host, String path) {
+
+        if (path.startsWith(PREFIX)) {
+            path = path.substring(PREFIX.length());
+        }
+
+        return super.getResource(host, path);
+    }
+}

Propchange: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingDavResourceFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingDavResourceFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev Url

Copied: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingFileResource.java
(from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingFileResource.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingFileResource.java?p2=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingFileResource.java&p1=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingFileResource.java&r1=988104&r2=1038653&rev=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingFileResource.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingFileResource.java
Wed Nov 24 15:50:16 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
 
 import org.apache.sling.api.resource.Resource;
 

Copied: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingResource.java
(from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResource.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingResource.java?p2=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingResource.java&p1=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResource.java&r1=988104&r2=1038653&rev=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResource.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingResource.java
Wed Nov 24 15:50:16 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
 
 import java.io.File;
 import java.io.IOException;

Copied: sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingResourceFactory.java
(from r988104, sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResourceFactory.java)
URL: http://svn.apache.org/viewvc/sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingResourceFactory.java?p2=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingResourceFactory.java&p1=sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResourceFactory.java&r1=988104&r2=1038653&rev=1038653&view=diff
==============================================================================
--- sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/SlingResourceFactory.java
(original)
+++ sling/whiteboard/fmeschbe/milton/src/main/java/org/apache/sling/whiteboard/fmeschbe/miltondav/impl/resources/SlingResourceFactory.java
Wed Nov 24 15:50:16 2010
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.whiteboard.fmeschbe.miltondav.impl;
+package org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources;
 
 import java.io.File;
 
@@ -32,22 +32,13 @@ import com.bradmcevoy.http.ResourceFacto
 
 public class SlingResourceFactory implements ResourceFactory {
 
-    static final String NAME = SlingResourceFactory.class.getName();
-
-    private static String PREFIX;
+    public static final String NAME = "org.apache.sling.whiteboard.fmeschbe.miltondav.impl.resources.SlingResourceFactory";
 
     public SlingResourceFactory() {
     }
 
-    static void setPrefix(final String prefix) {
-        PREFIX = prefix;
-    }
-
     public Resource getResource(final String host, String path) {
 
-        if (path.startsWith(PREFIX)) {
-            path = path.substring(PREFIX.length());
-        }
         if (path.length() == 0) {
             path = "/";
         } else if (path.length() > 1 && path.endsWith("/")) {



Mime
View raw message