sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1486579 - in /sling/trunk/bundles/jcr/davex: pom.xml src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java src/main/resources/OSGI-INF/metatype/metatype.properties
Date Mon, 27 May 2013 11:20:45 GMT
Author: fmeschbe
Date: Mon May 27 11:20:44 2013
New Revision: 1486579

URL: http://svn.apache.org/r1486579
Log:
SLING-2886 Apply Patch by Julian Reschke (thanks alot).

Modified:
    sling/trunk/bundles/jcr/davex/pom.xml
    sling/trunk/bundles/jcr/davex/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
    sling/trunk/bundles/jcr/davex/src/main/resources/OSGI-INF/metatype/metatype.properties

Modified: sling/trunk/bundles/jcr/davex/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/davex/pom.xml?rev=1486579&r1=1486578&r2=1486579&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/davex/pom.xml (original)
+++ sling/trunk/bundles/jcr/davex/pom.xml Mon May 27 11:20:44 2013
@@ -86,13 +86,13 @@
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>jackrabbit-jcr-server</artifactId>
-            <version>2.4.2</version>
+            <version>2.4.4</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
             <artifactId>jackrabbit-webdav</artifactId>
-            <version>2.4.2</version>
+            <version>2.4.4</version>
             <scope>provided</scope>
         </dependency>
 

Modified: sling/trunk/bundles/jcr/davex/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/davex/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java?rev=1486579&r1=1486578&r2=1486579&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/davex/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
(original)
+++ sling/trunk/bundles/jcr/davex/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
Mon May 27 11:20:44 2013
@@ -71,6 +71,16 @@ public class SlingDavExServlet extends J
     @Property(value=DEFAULT_DAV_ROOT)
     private static final String PROP_DAV_ROOT = "alias";
 
+    private static final boolean DEFAULT_CREATE_ABSOLUTE_URI = true;
+
+    /**
+     * Name of the property to configure whether absolute URIs ({@code true}) or
+     * absolute paths ({@code false}) are generated in responses. Default for
+     * the property is {@link #DEFAULT_CREATE_ABSOLUTE_URI}.
+     */
+    @Property(boolValue=DEFAULT_CREATE_ABSOLUTE_URI)
+    private static final String PROP_CREATE_ABSOLUTE_URI = "dav.create-absolute-uri";
+
     /**
      * The name of the service property of the registered dummy service to cause
      * the path to the DavEx servlet to not be subject to forced authentication.
@@ -110,6 +120,7 @@ public class SlingDavExServlet extends J
     @Activate
     protected void activate(final BundleContext bundleContext, final Map<String, ?>
config) {
         final String davRoot = OsgiUtil.toString(config.get(PROP_DAV_ROOT), DEFAULT_DAV_ROOT);
+        final boolean createAbsoluteUri = OsgiUtil.toBoolean(config.get(PROP_CREATE_ABSOLUTE_URI),
DEFAULT_CREATE_ABSOLUTE_URI);
 
         final AuthHttpContext context = new AuthHttpContext(davRoot);
         context.setAuthenticationSupport(authSupport);
@@ -120,6 +131,9 @@ public class SlingDavExServlet extends J
         // prefix to the servlet
         initProps.put(INIT_PARAM_RESOURCE_PATH_PREFIX, davRoot);
 
+        // create absolute URIs (or absolute paths)
+        initProps.put(INIT_PARAM_CREATE_ABSOLUTE_URI, Boolean.toString(createAbsoluteUri));
+
         // disable CSRF checks for now (should be handled by Sling)
         initProps.put(INIT_PARAM_CSRF_PROTECTION, CSRFUtil.DISABLED);
 

Modified: sling/trunk/bundles/jcr/davex/src/main/resources/OSGI-INF/metatype/metatype.properties
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/davex/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=1486579&r1=1486578&r2=1486579&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/davex/src/main/resources/OSGI-INF/metatype/metatype.properties
(original)
+++ sling/trunk/bundles/jcr/davex/src/main/resources/OSGI-INF/metatype/metatype.properties
Mon May 27 11:20:44 2013
@@ -33,6 +33,10 @@ dav.description = The DavEx Servlet allo
  requests to this servlet do not pass by the Sling Main Servlet and request \
  processing.
 
+dav.create-absolute-uri.name = Use absolute URIs
+dav.create-absolute-uri.description = When set to true, create absolute URIs \
+ in WebDAV responses. Otherwise, use absolute paths. (See RFC 4918, Section 8.3)
+
 alias.name = Root Path
 alias.description = The root path at which the DavEx Servlet is \
  accessible. The default value is "/server".



Mime
View raw message