Merged BRANCHES/DEV/THOR1_SPRINTS to HEAD:

36060: THOR-1373: Proxied WebDAV must generate correct URLs when URL-rewriting is used.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@39078 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Matt Ward
2012-07-11 14:30:25 +00:00
parent c923263bef
commit 91f9df2b23
6 changed files with 87 additions and 21 deletions

View File

@@ -347,8 +347,12 @@ public class WebDAVServlet extends HttpServlet
m_davMethods.put(WebDAV.METHOD_PUT, PutMethod.class);
m_davMethods.put(WebDAV.METHOD_UNLOCK, UnlockMethod.class);
}
protected WebDAVHelper getDAVHelper()
{
return m_davHelper;
}
/**
* @param storeValue
* @param rootPath
@@ -437,6 +441,8 @@ public class WebDAVServlet extends HttpServlet
private boolean enabled = false;
private String storeName;
private String rootPath;
private String urlPathPrefix;
public boolean getEnabled()
{
return enabled;
@@ -477,5 +483,39 @@ public class WebDAVServlet extends HttpServlet
{
this.rootPath = rootPath;
}
/**
* Get the path prefix that generated URLs should exhibit, e.g.
* <pre>
* http://server.name&lt;prefix&gt;/path/to/file.txt
* </pre>
* In the default set up this would be of the form /context-path/servlet-name e.g. /alfresco/webdav:
* <pre>
* http://server.name/alfresco/webdav/path/to/file.txt
* </pre>
* however if using URL rewriting rules or a reverse proxy in front of the webdav server
* you may choose to use, for example / for shorter URLs.
* <pre>
* http://server.name/path/to/file.txt
* </pre>
* <p>
* Leaving this property blank will cause the prefix used to be /context-path/servlet-name
*
* @return the urlPathPrefix
*/
public String getUrlPathPrefix()
{
return urlPathPrefix;
}
/**
* See {@link #getUrlPathPrefix()}
*
* @param urlPathPrefix
*/
public void setUrlPathPrefix(String urlPathPrefix)
{
this.urlPathPrefix = urlPathPrefix;
}
}
}