jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1868238 - in /jackrabbit/branches/2.18: ./ jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java
Date Thu, 10 Oct 2019 10:20:50 GMT
Author: reschke
Date: Thu Oct 10 10:20:50 2019
New Revision: 1868238

URL: http://svn.apache.org/viewvc?rev=1868238&view=rev
Log:
JCR-4475: Improve o.a.j.jcr2dav.RepositoryStubImpl to test with custom servlet path mapping
(patch by woon_san) (merged r1866234 into 2.18)

Modified:
    jackrabbit/branches/2.18/   (props changed)
    jackrabbit/branches/2.18/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java

Propchange: jackrabbit/branches/2.18/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Oct 10 10:20:50 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,1865748,1865991,1866280
+/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,1865748,1865991,1866234,1866280

Modified: jackrabbit/branches/2.18/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.18/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java?rev=1868238&r1=1868237&r2=1868238&view=diff
==============================================================================
--- jackrabbit/branches/2.18/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java
(original)
+++ jackrabbit/branches/2.18/jackrabbit-jcr2dav/src/test/java/org/apache/jackrabbit/jcr2dav/RepositoryStubImpl.java
Thu Oct 10 10:20:50 2019
@@ -54,7 +54,11 @@ public class RepositoryStubImpl extends
 
     private final String protectedRemoveImplClass;
 
-    private static final String WEBDAV_SERVLET_CONTEXT = System.getProperty("WebDAVServletContext",
"/");
+    private static final String WEBDAV_SERVLET_CONTEXT_PATH = System.getProperty("WebDAVServletContext",
"");
+
+    private static final String WEBDAV_SERVLET_PATH_PREFIX = System.getProperty("WebDAVServletPrefix",
"");
+
+    private static final String WEBDAV_SERVLET_PATH_MAPPING = WEBDAV_SERVLET_PATH_PREFIX
+ "/*";
 
     public RepositoryStubImpl(Properties env) {
         super(env);
@@ -76,16 +80,16 @@ public class RepositoryStubImpl extends
                     return repository;
                 }
             });
-            String pathPrefix = WEBDAV_SERVLET_CONTEXT;
+            String pathPrefix = WEBDAV_SERVLET_PATH_PREFIX;
             if (pathPrefix.endsWith("/")) {
-                pathPrefix = pathPrefix.substring(0,  pathPrefix.length() - 1);
+                pathPrefix = pathPrefix.substring(0, pathPrefix.length() - 1);
             }
             holder.setInitParameter(JCRWebdavServerServlet.INIT_PARAM_RESOURCE_PATH_PREFIX,
pathPrefix);
             holder.setInitParameter(JCRWebdavServerServlet.INIT_PARAM_MISSING_AUTH_MAPPING,
"");
             holder.setInitParameter(JcrRemotingServlet.INIT_PARAM_PROTECTED_HANDLERS_CONFIG,
protectedRemoveImplClass);
 
-            ServletContextHandler schandler = new ServletContextHandler(server, WEBDAV_SERVLET_CONTEXT);
-            schandler.addServlet(holder, "/*");
+            ServletContextHandler schandler = new ServletContextHandler(server, WEBDAV_SERVLET_CONTEXT_PATH);
+            schandler.addServlet(holder, WEBDAV_SERVLET_PATH_MAPPING);
         }
 
         if (connector == null) {
@@ -107,7 +111,7 @@ public class RepositoryStubImpl extends
             try {
                 Map<String, String> parameters = new HashMap<String, String>();
 
-                String uri = "http://localhost:" + connector.getLocalPort() + WEBDAV_SERVLET_CONTEXT;
+                String uri = "http://localhost:" + connector.getLocalPort() + WEBDAV_SERVLET_CONTEXT_PATH
+ WEBDAV_SERVLET_PATH_PREFIX;
 
                 String parmName = System.getProperty(this.getClass().getName() + ".REPURIPARM",
JcrUtils.REPOSITORY_URI);
                 parameters.put(parmName, uri);



Mime
View raw message