jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1868234 - in /jackrabbit/branches/2.18: ./ jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/ jackrabbit-webdav/src/main/java/org/apach...
Date Thu, 10 Oct 2019 09:23:50 GMT
Author: reschke
Date: Thu Oct 10 09:23:49 2019
New Revision: 1868234

URL: http://svn.apache.org/viewvc?rev=1868234&view=rev
Log:
JCR-4458: When JcrRemotingServlet deployed on non-root context, AclResource Webdav request
fails (patch by woon_san) (merged r1866280 into 2.18)

Added:
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavRequestContext.java
      - copied unchanged from r1866280, jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/WebdavRequestContext.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/WebdavRequestContextHolder.java
      - copied unchanged from r1866280, jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/WebdavRequestContextHolder.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/WebdavRequestContextImpl.java
      - copied unchanged from r1866280, jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/WebdavRequestContextImpl.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/AbstractReport.java
      - copied unchanged from r1866280, jackrabbit/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/AbstractReport.java
Modified:
    jackrabbit/branches/2.18/   (props changed)
    jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
    jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/VersionControlledItemCollection.java
    jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/WorkspaceResourceImpl.java
    jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/AbstractJcrReport.java
    jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/JcrPrivilegeReport.java
    jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/package-info.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/AbstractSecurityReport.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/AclPrincipalReport.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/SearchablePropertyReport.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/package-info.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/AbstractWebdavServlet.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/package-info.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/CompareBaselineReport.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ExpandPropertyReport.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/LatestActivityVersionReport.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/LocateByHistoryReport.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/VersionTreeReport.java
    jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/package-info.java

Propchange: jackrabbit/branches/2.18/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 10 09:23:49 2019
@@ -1,3 +1,3 @@
 /jackrabbit/branches/JCR-2272:1173165-1176545
 /jackrabbit/sandbox/JCR-2415-lucene-3.0:1060860-1064038
-/jackrabbit/trunk:1850224,1851360,1851369,1851372,1851380,1851384,1851904,1851946,1851953,1851961,1852417,1853927,1854018,1856855,1856969,1857631,1857721,1858564,1858566,1859534,1859563,1859633,1860118,1860123,1860645,1861773,1861777-1861778,1861781,1861786,1862283,1862783,1862805,1863196,1863222,1863384,1865525
+/jackrabbit/trunk:1850224,1851360,1851369,1851372,1851380,1851384,1851904,1851946,1851953,1851961,1852417,1853927,1854018,1856855,1856969,1857631,1857721,1858564,1858566,1859534,1859563,1859633,1860118,1860123,1860645,1861773,1861777-1861778,1861781,1861786,1862283,1862783,1862805,1863196,1863222,1863384,1865525,1866280

Modified: jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
Thu Oct 10 09:23:49 2019
@@ -26,6 +26,8 @@ import org.apache.jackrabbit.webdav.DavS
 import org.apache.jackrabbit.webdav.DavSession;
 import org.apache.jackrabbit.webdav.MultiStatus;
 import org.apache.jackrabbit.webdav.MultiStatusResponse;
+import org.apache.jackrabbit.webdav.WebdavRequest;
+import org.apache.jackrabbit.webdav.WebdavRequestContext;
 import org.apache.jackrabbit.webdav.DavCompliance;
 import org.apache.jackrabbit.webdav.jcr.property.JcrDavPropertyNameSet;
 import org.apache.jackrabbit.webdav.util.HttpDateFormat;
@@ -53,6 +55,7 @@ import org.apache.jackrabbit.webdav.prop
 import org.apache.jackrabbit.webdav.search.QueryGrammerSet;
 import org.apache.jackrabbit.webdav.search.SearchInfo;
 import org.apache.jackrabbit.webdav.search.SearchResource;
+import org.apache.jackrabbit.webdav.server.WebdavRequestContextHolder;
 import org.apache.jackrabbit.webdav.transaction.TransactionConstants;
 import org.apache.jackrabbit.webdav.transaction.TransactionInfo;
 import org.apache.jackrabbit.webdav.transaction.TransactionResource;
@@ -759,6 +762,33 @@ abstract class AbstractResource implemen
         return HttpDateFormat.creationDateFormat().format(new Date(0));
     }
 
+    /**
+     * Normalize the resource {@code href}. For example, remove contextPath prefix if found.
+     * @param href resource href
+     * @return normalized resource {@code href}
+     */
+    protected String normalizeResourceHref(final String href) {
+        if (href == null) {
+            return href;
+        }
+
+        final WebdavRequestContext requestContext = WebdavRequestContextHolder.getContext();
+        final WebdavRequest request = (requestContext != null) ? requestContext.getRequest()
: null;
+
+        if (request == null) {
+            log.error("WebdavRequest is unavailable in the current execution context.");
+            return href;
+        }
+
+        final String contextPath = request.getContextPath();
+
+        if (!contextPath.isEmpty() && href.startsWith(contextPath)) {
+            return href.substring(contextPath.length());
+        }
+
+        return href;
+    }
+
     //--------------------------------------------------------------------------
     /**
      * Register the specified event listener with the observation manager present

Modified: jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/VersionControlledItemCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/VersionControlledItemCollection.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/VersionControlledItemCollection.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/VersionControlledItemCollection.java
Thu Oct 10 09:23:49 2019
@@ -400,7 +400,8 @@ public class VersionControlledItemCollec
                     throw new DavException(DavServletResponse.SC_BAD_REQUEST, "Invalid update
request body missing version href or containing multiple version hrefs.");
                 }
 
-                String versionPath = getLocatorFromHref(hrefs[0]).getRepositoryPath();
+                final String href = normalizeResourceHref(hrefs[0]);
+                String versionPath = getLocatorFromHref(href).getRepositoryPath();
                 String versionName = getItemName(versionPath);
 
                 String relPath = DomUtil.getChildText(udElem, XML_RELPATH, NAMESPACE);
@@ -423,7 +424,7 @@ public class VersionControlledItemCollec
                 node.restoreByLabel(labels[0], removeExisting);
 
             } else if (updateInfo.getWorkspaceHref() != null) {
-                String href = obtainAbsolutePathFromUri(updateInfo.getWorkspaceHref());
+                String href = normalizeResourceHref(obtainAbsolutePathFromUri(updateInfo.getWorkspaceHref()));
                 String workspaceName = getLocatorFromHref(href).getWorkspaceName();
                 node.update(workspaceName);
             } else {
@@ -469,7 +470,8 @@ public class VersionControlledItemCollec
             // resources that got modified by this merge operation -> omitted.
             
             // todo: RFC allows multiple href elements inside the DAV:source element
-            String workspaceName = getLocatorFromHref(mergeInfo.getSourceHrefs()[0]).getWorkspaceName();
+            final String href = normalizeResourceHref(mergeInfo.getSourceHrefs()[0]);
+            String workspaceName = getLocatorFromHref(href).getWorkspaceName();
 
             String depth = DomUtil.getChildTextTrim(mergeInfo.getMergeElement(), DavConstants.XML_DEPTH,
DavConstants.NAMESPACE);
             boolean isShallow = "0".equals(depth);

Modified: jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/WorkspaceResourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/WorkspaceResourceImpl.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/WorkspaceResourceImpl.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/WorkspaceResourceImpl.java
Thu Oct 10 09:23:49 2019
@@ -537,7 +537,8 @@ public class WorkspaceResourceImpl exten
             // perform the update/restore according to the update info
             Version[] versions = new Version[hrefs.length];
             for (int i = 0; i < hrefs.length; i++) {
-                DavResourceLocator vLoc = getLocator().getFactory().createResourceLocator(getLocator().getPrefix(),
hrefs[i]);
+                final String href = normalizeResourceHref(hrefs[i]);
+                DavResourceLocator vLoc = getLocator().getFactory().createResourceLocator(getLocator().getPrefix(),
href);
                 String versionPath = vLoc.getRepositoryPath();
                 Item item = getRepositorySession().getItem(versionPath);
                 if (item instanceof Version) {

Modified: jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/AbstractJcrReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/AbstractJcrReport.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/AbstractJcrReport.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/AbstractJcrReport.java
Thu Oct 10 09:23:49 2019
@@ -16,21 +16,22 @@
  */
 package org.apache.jackrabbit.webdav.jcr.version.report;
 
+import javax.jcr.Session;
+
 import org.apache.jackrabbit.webdav.DavConstants;
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.DavResource;
 import org.apache.jackrabbit.webdav.DavServletResponse;
 import org.apache.jackrabbit.webdav.DavSession;
 import org.apache.jackrabbit.webdav.jcr.JcrDavSession;
+import org.apache.jackrabbit.webdav.version.report.AbstractReport;
 import org.apache.jackrabbit.webdav.version.report.Report;
 import org.apache.jackrabbit.webdav.version.report.ReportInfo;
 
-import javax.jcr.Session;
-
 /**
  * <code>AbstractJcrReport</code>...
  */
-public abstract class AbstractJcrReport implements Report {
+public abstract class AbstractJcrReport extends AbstractReport {
 
     private Session session;
     private ReportInfo reportInfo;
@@ -80,4 +81,4 @@ public abstract class AbstractJcrReport
     ReportInfo getReportInfo() {
         return reportInfo;
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/JcrPrivilegeReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/JcrPrivilegeReport.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/JcrPrivilegeReport.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/JcrPrivilegeReport.java
Thu Oct 10 09:23:49 2019
@@ -107,7 +107,7 @@ public class JcrPrivilegeReport extends
         // immediately build the final multistatus element
         Element hrefElem = info.getContentElement(DavConstants.XML_HREF, DavConstants.NAMESPACE);
         String href = DomUtil.getTextTrim(hrefElem);
-        href = obtainAbsolutePathFromUri(href); // TODO: we should check whether the authority
component matches
+        href = normalizeResourceHref(obtainAbsolutePathFromUri(href)); // TODO: we should
check whether the authority component matches
         DavResourceLocator resourceLoc = resource.getLocator();
         DavResourceLocator loc = resourceLoc.getFactory().createResourceLocator(resourceLoc.getPrefix(),
href);
         // immediately build the final multistatus element
@@ -159,4 +159,4 @@ public class JcrPrivilegeReport extends
             return uri;
         }
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/version/report/LocateCorrespondingNodeReport.java
Thu Oct 10 09:23:49 2019
@@ -102,7 +102,7 @@ public class LocateCorrespondingNodeRepo
         super.init(resource, info);
         // specific for this report: a workspace href must be provided
         Element workspace = info.getContentElement(DeltaVConstants.WORKSPACE.getName(), DeltaVConstants.WORKSPACE.getNamespace());
-        String workspaceHref = DomUtil.getChildTextTrim(workspace, DavConstants.XML_HREF,
DavConstants.NAMESPACE);
+        String workspaceHref = normalizeResourceHref(DomUtil.getChildTextTrim(workspace,
DavConstants.XML_HREF, DavConstants.NAMESPACE));
         if (workspaceHref == null || "".equals(workspaceHref)) {
             throw new DavException(DavServletResponse.SC_BAD_REQUEST, "Request body must
define the href of a source workspace");
         }

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/package-info.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/package-info.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/package-info.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/package-info.java
Thu Oct 10 09:23:49 2019
@@ -14,5 +14,5 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-@org.osgi.annotation.versioning.Version("1.2.0")
+@org.osgi.annotation.versioning.Version("1.3.0")
 package org.apache.jackrabbit.webdav;

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/AbstractSecurityReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/AbstractSecurityReport.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/AbstractSecurityReport.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/AbstractSecurityReport.java
Thu Oct 10 09:23:49 2019
@@ -22,6 +22,7 @@ import org.apache.jackrabbit.webdav.DavR
 import org.apache.jackrabbit.webdav.DavServletResponse;
 import org.apache.jackrabbit.webdav.MultiStatus;
 import org.apache.jackrabbit.webdav.MultiStatusResponse;
+import org.apache.jackrabbit.webdav.version.report.AbstractReport;
 import org.apache.jackrabbit.webdav.version.report.Report;
 import org.apache.jackrabbit.webdav.version.report.ReportInfo;
 import org.w3c.dom.Document;
@@ -31,7 +32,7 @@ import org.w3c.dom.Element;
  * <code>AbstractSecurityReport</code> covers basic validation and utilities
  * common to the majority of the reports defined within RFC 3744.
  */
-public abstract class AbstractSecurityReport implements Report {
+public abstract class AbstractSecurityReport extends AbstractReport {
 
     protected MultiStatusResponse[] responses;
 

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/AclPrincipalReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/AclPrincipalReport.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/AclPrincipalReport.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/AclPrincipalReport.java
Thu Oct 10 09:23:49 2019
@@ -81,7 +81,7 @@ public class AclPrincipalReport extends
         Map<String, MultiStatusResponse> respMap = new HashMap<String, MultiStatusResponse>();
         List<AclProperty.Ace> list = (List<AclProperty.Ace>) ((AclProperty)acl).getValue();
         for (AclProperty.Ace ace : list) {
-            String href = ace.getPrincipal().getHref();
+            String href = normalizeResourceHref(ace.getPrincipal().getHref());
             if (href == null || respMap.containsKey(href)) {
                 // ignore non-href principals and principals that have been listed before
                 continue;
@@ -93,4 +93,4 @@ public class AclPrincipalReport extends
         }
         this.responses = respMap.values().toArray(new MultiStatusResponse[respMap.size()]);
     }
-}
\ No newline at end of file
+}

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/SearchablePropertyReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/SearchablePropertyReport.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/SearchablePropertyReport.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/SearchablePropertyReport.java
Thu Oct 10 09:23:49 2019
@@ -16,6 +16,9 @@
  */
 package org.apache.jackrabbit.webdav.security.report;
 
+import java.util.HashSet;
+import java.util.Set;
+
 import org.apache.jackrabbit.webdav.DavConstants;
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.DavResource;
@@ -23,6 +26,7 @@ import org.apache.jackrabbit.webdav.DavS
 import org.apache.jackrabbit.webdav.property.DavPropertyName;
 import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
 import org.apache.jackrabbit.webdav.security.SecurityConstants;
+import org.apache.jackrabbit.webdav.version.report.AbstractReport;
 import org.apache.jackrabbit.webdav.version.report.Report;
 import org.apache.jackrabbit.webdav.version.report.ReportInfo;
 import org.apache.jackrabbit.webdav.version.report.ReportType;
@@ -32,9 +36,6 @@ import org.apache.jackrabbit.webdav.xml.
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import java.util.HashSet;
-import java.util.Set;
-
 /**
  * <code>SearchablePropertyReport</code> identifies those properties that may
be
  * searched using the {@link PrincipalSearchReport DAV:principal-property-search REPORT}.
@@ -57,7 +58,7 @@ import java.util.Set;
  * Note that a DAV:principal-search-property XML element is required for each
  * property that may be searched with the DAV:principal-property-search REPORT.
  */
-public class SearchablePropertyReport implements Report {
+public class SearchablePropertyReport extends AbstractReport {
 
     /**
      * The report name

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/package-info.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/package-info.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/package-info.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/security/report/package-info.java
Thu Oct 10 09:23:49 2019
@@ -14,5 +14,5 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-@org.osgi.annotation.versioning.Version("1.0.0")
+@org.osgi.annotation.versioning.Version("1.1.0")
 package org.apache.jackrabbit.webdav.security.report;

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/AbstractWebdavServlet.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/AbstractWebdavServlet.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/AbstractWebdavServlet.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/AbstractWebdavServlet.java
Thu Oct 10 09:23:49 2019
@@ -273,7 +273,10 @@ abstract public class AbstractWebdavServ
         int methodCode = DavMethods.getMethodCode(request.getMethod());
         boolean noCache = DavMethods.isDeltaVMethod(webdavRequest) && !(DavMethods.DAV_VERSION_CONTROL
== methodCode || DavMethods.DAV_REPORT == methodCode);
         WebdavResponse webdavResponse = new WebdavResponseImpl(response, noCache);
+
         try {
+            WebdavRequestContextHolder.setContext(new WebdavRequestContextImpl(webdavRequest));
+
             // make sure there is a authenticated user
             if (!getDavSessionProvider().attachSession(webdavRequest)) {
                 return;
@@ -313,6 +316,7 @@ abstract public class AbstractWebdavServ
                 webdavResponse.sendError(e);
             }
         } finally {
+            WebdavRequestContextHolder.clearContext();
             getDavSessionProvider().releaseSession(webdavRequest);
         }
     }

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/package-info.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/package-info.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/package-info.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/server/package-info.java
Thu Oct 10 09:23:49 2019
@@ -14,5 +14,5 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-@org.osgi.annotation.versioning.Version("1.0.0")
+@org.osgi.annotation.versioning.Version("1.1.0")
 package org.apache.jackrabbit.webdav.server;

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/CompareBaselineReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/CompareBaselineReport.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/CompareBaselineReport.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/CompareBaselineReport.java
Thu Oct 10 09:23:49 2019
@@ -16,30 +16,30 @@
  */
 package org.apache.jackrabbit.webdav.version.report;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.jackrabbit.webdav.DavResource;
-import org.apache.jackrabbit.webdav.DavException;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.jackrabbit.webdav.DavConstants;
-import org.apache.jackrabbit.webdav.DavServletResponse;
-import org.apache.jackrabbit.webdav.DavResourceLocator;
+import org.apache.jackrabbit.webdav.DavException;
+import org.apache.jackrabbit.webdav.DavResource;
 import org.apache.jackrabbit.webdav.DavResourceIterator;
+import org.apache.jackrabbit.webdav.DavResourceLocator;
+import org.apache.jackrabbit.webdav.DavServletResponse;
 import org.apache.jackrabbit.webdav.property.HrefProperty;
-import org.apache.jackrabbit.webdav.xml.DomUtil;
-import org.apache.jackrabbit.webdav.version.DeltaVConstants;
 import org.apache.jackrabbit.webdav.version.BaselineResource;
-import org.apache.jackrabbit.webdav.version.VersionResource;
+import org.apache.jackrabbit.webdav.version.DeltaVConstants;
 import org.apache.jackrabbit.webdav.version.VersionControlledResource;
-import org.w3c.dom.Element;
+import org.apache.jackrabbit.webdav.version.VersionResource;
+import org.apache.jackrabbit.webdav.xml.DomUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
-
-import java.util.List;
-import java.util.ArrayList;
+import org.w3c.dom.Element;
 
 /**
  * <code>CompareBaselineReport</code>...
  */
-public class CompareBaselineReport implements Report {
+public class CompareBaselineReport extends AbstractReport {
 
     private static Logger log = LoggerFactory.getLogger(CompareBaselineReport.class);
 
@@ -95,7 +95,7 @@ public class CompareBaselineReport imple
 
         // make sure the DAV:href element inside the request body points to
         // an baseline resource (precondition for this report).
-        String compareHref = DomUtil.getText(info.getContentElement(DavConstants.XML_HREF,
DavConstants.NAMESPACE));
+        String compareHref = normalizeResourceHref(DomUtil.getText(info.getContentElement(DavConstants.XML_HREF,
DavConstants.NAMESPACE)));
         DavResourceLocator locator = resource.getLocator();
         DavResourceLocator compareLocator = locator.getFactory().createResourceLocator(locator.getPrefix(),
compareHref);
 

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ExpandPropertyReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ExpandPropertyReport.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ExpandPropertyReport.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/ExpandPropertyReport.java
Thu Oct 10 09:23:49 2019
@@ -16,6 +16,10 @@
  */
 package org.apache.jackrabbit.webdav.version.report;
 
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.DavResource;
 import org.apache.jackrabbit.webdav.DavResourceIterator;
@@ -36,10 +40,6 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  * <code>ExpandPropertyReport</code> encapsulates the DAV:expand-property report,
  * that provides a mechanism for retrieving in one request the properties from
@@ -61,7 +61,7 @@ import java.util.List;
  * @see DeltaVConstants#XML_EXPAND_PROPERTY
  * @see DeltaVConstants#XML_PROPERTY
  */
-public class ExpandPropertyReport implements Report, DeltaVConstants {
+public class ExpandPropertyReport extends AbstractReport implements DeltaVConstants {
 
     private static Logger log = LoggerFactory.getLogger(ExpandPropertyReport.class);
 

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/LatestActivityVersionReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/LatestActivityVersionReport.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/LatestActivityVersionReport.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/LatestActivityVersionReport.java
Thu Oct 10 09:23:49 2019
@@ -16,30 +16,30 @@
  */
 package org.apache.jackrabbit.webdav.version.report;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.jackrabbit.webdav.DavResource;
-import org.apache.jackrabbit.webdav.DavException;
-import org.apache.jackrabbit.webdav.DavServletResponse;
+import java.util.List;
+
 import org.apache.jackrabbit.webdav.DavConstants;
+import org.apache.jackrabbit.webdav.DavException;
+import org.apache.jackrabbit.webdav.DavResource;
 import org.apache.jackrabbit.webdav.DavResourceLocator;
+import org.apache.jackrabbit.webdav.DavServletResponse;
 import org.apache.jackrabbit.webdav.property.HrefProperty;
-import org.apache.jackrabbit.webdav.xml.DomUtil;
-import org.apache.jackrabbit.webdav.version.VersionHistoryResource;
 import org.apache.jackrabbit.webdav.version.ActivityResource;
 import org.apache.jackrabbit.webdav.version.DeltaVConstants;
+import org.apache.jackrabbit.webdav.version.VersionHistoryResource;
 import org.apache.jackrabbit.webdav.version.VersionResource;
-import org.w3c.dom.Element;
+import org.apache.jackrabbit.webdav.xml.DomUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
-
-import java.util.List;
+import org.w3c.dom.Element;
 
 /**
  * <code>LatestActivityVersionReport</code> is applied to a version history to
  * identify the latest version that is selected from that version history by a
  * given activity.
  */
-public class LatestActivityVersionReport implements Report {
+public class LatestActivityVersionReport extends AbstractReport {
 
     private static Logger log = LoggerFactory.getLogger(LatestActivityVersionReport.class);
 
@@ -91,7 +91,7 @@ public class LatestActivityVersionReport
 
         // make sure the DAV:href element inside the request body points to
         // an activity resource (precondition for this report).
-        String activityHref = DomUtil.getText(info.getContentElement(DavConstants.XML_HREF,
DavConstants.NAMESPACE));
+        String activityHref = normalizeResourceHref(DomUtil.getText(info.getContentElement(DavConstants.XML_HREF,
DavConstants.NAMESPACE)));
         DavResourceLocator vhLocator = resource.getLocator();
         DavResourceLocator activityLocator = vhLocator.getFactory().createResourceLocator(vhLocator.getPrefix(),
activityHref);
 

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/LocateByHistoryReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/LocateByHistoryReport.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/LocateByHistoryReport.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/LocateByHistoryReport.java
Thu Oct 10 09:23:49 2019
@@ -16,6 +16,9 @@
  */
 package org.apache.jackrabbit.webdav.version.report;
 
+import java.util.HashSet;
+import java.util.Set;
+
 import org.apache.jackrabbit.webdav.DavConstants;
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.DavResource;
@@ -33,9 +36,6 @@ import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import java.util.HashSet;
-import java.util.Set;
-
 /**
  * <code>LocateByHistoryReport</code> encapsulates the DAV:locate-by-hisotry
  * report, that may be used to locate a version-controlled resource for that
@@ -48,7 +48,7 @@ import java.util.Set;
  * &lt;!ELEMENT version-history-set (href+)&gt;
  * </pre>
  */
-public class LocateByHistoryReport implements Report, DeltaVConstants {
+public class LocateByHistoryReport extends AbstractReport implements DeltaVConstants {
 
     private static Logger log = LoggerFactory.getLogger(LocateByHistoryReport.class);
 

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/VersionTreeReport.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/VersionTreeReport.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/VersionTreeReport.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/VersionTreeReport.java
Thu Oct 10 09:23:49 2019
@@ -36,7 +36,7 @@ import org.w3c.dom.Element;
  * history of a version. The DAV:version-tree report must be supported by all
  * version resources and all version-controlled resources.
  */
-public class VersionTreeReport implements Report, DeltaVConstants {
+public class VersionTreeReport extends AbstractReport implements DeltaVConstants {
 
     private static Logger log = LoggerFactory.getLogger(VersionTreeReport.class);
 

Modified: jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/package-info.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/package-info.java?rev=1868234&r1=1868233&r2=1868234&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/package-info.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/version/report/package-info.java
Thu Oct 10 09:23:49 2019
@@ -14,5 +14,5 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-@org.osgi.annotation.versioning.Version("1.0.0")
+@org.osgi.annotation.versioning.Version("1.1.0")
 package org.apache.jackrabbit.webdav.version.report;



Mime
View raw message