Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ABB33200D35 for ; Tue, 7 Nov 2017 10:49:40 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AA561160C14; Tue, 7 Nov 2017 09:49:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 00800160C37 for ; Tue, 7 Nov 2017 10:49:34 +0100 (CET) Received: (qmail 35486 invoked by uid 500); 7 Nov 2017 09:49:33 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 35006 invoked by uid 99); 7 Nov 2017 09:49:33 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Nov 2017 09:49:33 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 5BCB487A5A; Tue, 7 Nov 2017 09:49:33 +0000 (UTC) Date: Tue, 07 Nov 2017 09:51:40 +0000 To: "commits@sling.apache.org" Subject: [sling-org-apache-sling-jcr-webdav] 05/07: SLING-2825 : sling webdav servlet should support config property "createAbsoluteURI" . Apply patch from Julian Reschke MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: rombert@apache.org In-Reply-To: <151004816437.22970.10698517822189435882@gitbox.apache.org> References: <151004816437.22970.10698517822189435882@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: sling-org-apache-sling-jcr-webdav X-Git-Refname: refs/tags/org.apache.sling.jcr.webdav-2.2.0 X-Git-Reftype: annotated tag X-Git-Rev: c7d2fe5c39f16ab98c6ac19ff19cebb87d771af2 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20171107094933.5BCB487A5A@gitbox.apache.org> archived-at: Tue, 07 Nov 2017 09:49:40 -0000 This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.jcr.webdav-2.2.0 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-webdav.git commit c7d2fe5c39f16ab98c6ac19ff19cebb87d771af2 Author: Carsten Ziegeler AuthorDate: Thu May 16 07:50:56 2013 +0000 SLING-2825 : sling webdav servlet should support config property "createAbsoluteURI" . Apply patch from Julian Reschke git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/webdav@1483223 13f79535-47bb-0310-9956-ffa450edef68 --- pom.xml | 3 +-- .../sling/jcr/webdav/impl/helper/SlingResourceConfig.java | 11 +++++++++-- .../sling/jcr/webdav/impl/servlets/SlingWebDavServlet.java | 5 +++++ src/main/resources/OSGI-INF/metatype/metatype.properties | 4 ++++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index e9d1bd0..bae7b79 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,6 @@ org.apache.felix maven-bundle-plugin - 2.3.4 true @@ -116,7 +115,7 @@ org.apache.jackrabbit jackrabbit-jcr-server - 2.4.2 + 2.4.4 compile diff --git a/src/main/java/org/apache/sling/jcr/webdav/impl/helper/SlingResourceConfig.java b/src/main/java/org/apache/sling/jcr/webdav/impl/helper/SlingResourceConfig.java index eab6da0..b0e16da 100644 --- a/src/main/java/org/apache/sling/jcr/webdav/impl/helper/SlingResourceConfig.java +++ b/src/main/java/org/apache/sling/jcr/webdav/impl/helper/SlingResourceConfig.java @@ -92,8 +92,15 @@ public class SlingResourceConfig extends ResourceConfig { config.get(SlingWebDavServlet.PROP_REALM), SlingWebDavServlet.DEFAULT_REALM); servletInitParams.put( - SimpleWebdavServlet.INIT_PARAM_AUTHENTICATE_HEADER, - "Basic realm=\"" + value + "\""); + SimpleWebdavServlet.INIT_PARAM_AUTHENTICATE_HEADER, + "Basic realm=\"" + value + "\""); + + boolean createAbsoluteUri = OsgiUtil.toBoolean( + config.get(SlingWebDavServlet.PROP_CREATE_ABSOLUTE_URI), + SlingWebDavServlet.DEFAULT_CREATE_ABSOLUTE_URI); + servletInitParams.put( + SimpleWebdavServlet.INIT_PARAM_CREATE_ABSOLUTE_URI, + Boolean.toString(createAbsoluteUri)); } // ---------- ResourceConfig overwrites diff --git a/src/main/java/org/apache/sling/jcr/webdav/impl/servlets/SlingWebDavServlet.java b/src/main/java/org/apache/sling/jcr/webdav/impl/servlets/SlingWebDavServlet.java index 2e70cb6..72c45bc 100644 --- a/src/main/java/org/apache/sling/jcr/webdav/impl/servlets/SlingWebDavServlet.java +++ b/src/main/java/org/apache/sling/jcr/webdav/impl/servlets/SlingWebDavServlet.java @@ -83,6 +83,11 @@ public class SlingWebDavServlet extends SimpleWebdavServlet { @Property(DEFAULT_CONTEXT) public static final String PROP_CONTEXT = "dav.root"; + public static final boolean DEFAULT_CREATE_ABSOLUTE_URI = true; + + @Property(boolValue=DEFAULT_CREATE_ABSOLUTE_URI) + public static final String PROP_CREATE_ABSOLUTE_URI = "dav.create-absolute-uri"; + public static final String DEFAULT_REALM = "Sling WebDAV"; @Property(DEFAULT_REALM) diff --git a/src/main/resources/OSGI-INF/metatype/metatype.properties b/src/main/resources/OSGI-INF/metatype/metatype.properties index 78b4793..2a3cb41 100644 --- a/src/main/resources/OSGI-INF/metatype/metatype.properties +++ b/src/main/resources/OSGI-INF/metatype/metatype.properties @@ -69,6 +69,10 @@ dav.realm.description = The name of the HTTP Basic Authentication Realm \ presented to the client to ask for authentication credentials to access the \ repository. +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) + collection.types.name = Non Collection Node Types collection.types.description = The JCR Node Types considered being \ non-collection resouces by WebDAV. Any node replying true to Node.isNodeType() \ -- To stop receiving notification emails like this one, please contact "commits@sling.apache.org" .