This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.davex-1.2.0
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-davex.git

commit 634c05b33af3271d6d934823e2ab1835ed585d9c
Author: Felix Meschberger <[email protected]>
AuthorDate: Mon May 27 11:20:44 2013 +0000

    SLING-2886 Apply Patch by Julian Reschke (thanks alot).
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex@1486579 
13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                    |  4 ++--
 .../sling/jcr/davex/impl/servlets/SlingDavExServlet.java   | 14 ++++++++++++++
 src/main/resources/OSGI-INF/metatype/metatype.properties   |  4 ++++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1327e8b..6debfe8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -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>
 
diff --git 
a/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java 
b/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
index ec1f85d..ef3319a 100644
--- 
a/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
+++ 
b/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
@@ -71,6 +71,16 @@ public class SlingDavExServlet extends JcrRemotingServlet {
     @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 JcrRemotingServlet {
     @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 JcrRemotingServlet {
         // 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);
 
diff --git a/src/main/resources/OSGI-INF/metatype/metatype.properties 
b/src/main/resources/OSGI-INF/metatype/metatype.properties
index 1eee1cd..40ba4aa 100644
--- a/src/main/resources/OSGI-INF/metatype/metatype.properties
+++ b/src/main/resources/OSGI-INF/metatype/metatype.properties
@@ -33,6 +33,10 @@ dav.description = The DavEx Servlet allows direct access to 
the \
  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".

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to