Additional top-level class in compilation unit: WebdavStatus.
Mapping a subpath (e.g. /webdav/* to this servlet has the effect of re-mounting the entire web
application under that sub-path, with WebDAV access to all the resources. The WEB-INF and
META-INF directories are protected in this re-mounted resource tree.
To enable WebDAV for a context add the following to web.xml:
<servlet>
<servlet-name>webdav</servlet-name>
<servlet-class>org.apache.catalina.servlets.WebdavServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>webdav</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
This will enable read only access. To enable read-write access add:
<init-param> <param-name>readonly</param-name> <param-value>false</param-value> </init-param>To make the content editable via a different URL, use the following mapping:
<servlet-mapping> <servlet-name>webdav</servlet-name> <url-pattern>/webdavedit/*</url-pattern> </servlet-mapping>By default access to /WEB-INF and META-INF are not available via WebDAV. To enable access to these URLs, use add:
<init-param> <param-name>allowSpecialPaths</param-name> <param-value>true</param-value> </init-param>Don't forget to secure access appropriately to the editing URLs, especially if allowSpecialPaths is used. With the mapping configuration above, the context will be accessible to normal users as before. Those users with the necessary access will be able to edit content available via http://host:port/context/content using http://host:port/context/webdavedit/content
| Modifier and Type | Class and Description |
|---|---|
| private static class | WebdavServlet.
Holds a lock information. |
| private static class | WebdavServlet.
Work around for XML parsers that don't fully respect
|
| Modifier and Type | Field and Description |
|---|---|
| private boolean | allowSpecialPaths
Is access allowed via WebDAV to the special paths (/WEB-INF and /META-INF)? |
| private final List | collectionLocks
List of the inheritable collection locks. |
| protected static final ConcurrentDateFormat | creationDateFormat
Simple date format for the creation date ISO representation (partial). |
| protected static final String | DEFAULT_NAMESPACE
Default namespace. |
| private static final int | DEFAULT_TIMEOUT
Default lock timeout value. |
| private static final int | FIND_ALL_PROP
PROPFIND - Display all properties. |
| private static final int | FIND_BY_PROPERTY
PROPFIND - Specify a property mask. |
| private static final int | FIND_PROPERTY_NAMES
PROPFIND - Return property names. |
| private static final int | LOCK_CREATION
Create a new lock. |
| private static final int | LOCK_REFRESH
Refresh lock. |
| private final Map | lockNullResources
Repository of the lock-null resources. |
| private static final int | MAX_TIMEOUT
Maximum lock timeout. |
| private int | maxDepth
Default depth in spec is infinite. |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private final Map | resourceLocks
Repository of the locks put on single resources. |
| private String | secret
Secret information used to generate reasonably secure lock ids. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | checkIfHeaders(HttpServletRequest
The servlet request we are processing request, HttpServletResponse The servlet response we are creating response, WebResource The resource resource)Overrides org. Check if the conditions specified in the optional If headers are satisfied. |
| private boolean | Returns: boolean true if the copy is successfulServlet request req, HttpServletResponse Servlet response resp)Copy a resource. |
| private boolean | |
| private void | deleteCollection(HttpServletRequest
The Servlet request req, String Path to the collection to be deleted path, Map<String, Integer> Contains the list of the errors which occurred errorList)Deletes a collection. |
| private boolean | Returns: true if the delete is successfulServlet request req, HttpServletResponse Servlet response resp)Delete a resource. |
| private boolean | Returns: true if the delete is successfulPath of the resource which is to be deleted path, HttpServletRequest Servlet request req, HttpServletResponse Servlet response resp, boolean Should the response status be set on successful completion setStatus)Delete a resource. |
| protected String | Returns: The allowed HTTP methodsThe Servlet request req)Overrides org. Determines the methods normally allowed for the resource. |
| protected void | doCopy(HttpServletRequest
The Servlet request req, HttpServletResponse The Servlet response resp)COPY Method. |
| protected void | doDelete(HttpServletRequest
The Servlet request req, HttpServletResponse The Servlet response resp)Overrides org. DELETE Method. |
| protected void | doLock(HttpServletRequest
The Servlet request req, HttpServletResponse The Servlet response resp)LOCK Method. |
| protected void | doMkcol(HttpServletRequest
The Servlet request req, HttpServletResponse The Servlet response resp)MKCOL Method. |
| protected void | doMove(HttpServletRequest
The Servlet request req, HttpServletResponse The Servlet response resp)MOVE Method. |
| protected void | doOptions(HttpServletRequest
The Servlet request req, HttpServletResponse The Servlet response resp)Overrides org. OPTIONS Method. |
| protected void | doPropfind(HttpServletRequest
The Servlet request req, HttpServletResponse The Servlet response resp)PROPFIND Method. |
| protected void | doProppatch(HttpServletRequest
The Servlet request req, HttpServletResponse The Servlet response resp)PROPPATCH Method. |
| protected void | doPut(HttpServletRequest
The servlet request we are processing req, HttpServletResponse The servlet response we are creating resp)Overrides org. Process a PUT request for the specified resource. |
| protected void | doUnlock(HttpServletRequest
The Servlet request req, HttpServletResponse The Servlet response resp)UNLOCK Method. |
| private boolean | Returns: true if at least one lock was displayedPath path, XMLWriter XML data to which the locks info will be appended generatedXML)Print the lock discovery information associated with a path. |
| private void | |
| protected DocumentBuilder | |
| private String | Returns: the formatted creation dateGet creation date in ISO format. |
| protected String | getPathPrefix(final HttpServletRequest
the request to determine the path for request)Overrides org. Determines the prefix for standard directory GET listings. |
| protected String | getRelativePath(HttpServletRequest
The servlet request we are processing request)Overrides org. Override the DefaultServlet implementation and only use the PathInfo. |
| protected String | getRelativePath(HttpServletRequest request, boolean allowEmptyPath)
Overrides org.
|
| public void | |
| private boolean | Returns: true if the resource is locked (and no appropriate lock token has been found for at least
one of the non-shared locks which are present on the resource).Servlet request req)Check to see if a resource is currently write locked. |
| private boolean | Returns: true if the resource is locked (and no appropriate lock token has been found for at least
one of the non-shared locks which are present on the resource).Path of the resource path, String "If" HTTP header which was included in the request ifHeader)Check to see if a resource is currently write locked. |
| private boolean | Returns: true if the resource specified is under a special paththe full path of the resource being accessed path)Checks whether a given path refers to a resource under |
| private void | parseLockNullProperties(HttpServletRequest
The servlet request req, XMLWriter XML response to the Propfind request generatedXML, String Path of the current resource path, int Propfind type type, List<String> If the propfind type is find properties by name, then this List contains those properties properties)Propfind helper method. |
| private void | parseProperties(HttpServletRequest
The servlet request req, XMLWriter XML response to the Propfind request generatedXML, String Path of the current resource path, int Propfind type type, List<String> If the propfind type is find properties by name, then this List contains those properties properties)Propfind helper method. |
| private void | sendReport(HttpServletRequest
Servlet request req, HttpServletResponse Servlet response resp, Map<String, Integer> List of error to be displayed errorList)Send a multistatus element containing a complete error report to the client. |
| protected void | service(HttpServletRequest
the req, HttpServletResponse HttpServletRequest object that contains the request the client made of the servletthe resp)HttpServletResponse object that contains the response the servlet returns to the clientOverrides org. Handles the special WebDAV methods. |