SK.gnome.dwarf.http.webdav
Class WebDAVServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bySK.gnome.dwarf.http.servlet.FileServlet
              extended bySK.gnome.dwarf.http.webdav.WebDAVServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class WebDAVServlet
extends FileServlet

This servlet implements the WebDAV protocol.

Currently, all resources supported by this servlet are Class 1 compliant.

Each servlet instance must be mapped to the reserved "/webdav/*" URI pattern. In fact, this means that a single web application may contain only one WebDAVServlet instance.

The servlet recognizes one initial configuration parameter "clientEncoding", which must contain a valid MIME encoding used by the client program to escape the URL paths being sent to the server. By default the WebDAV servlet tries to auto-detect the encoding used in the requests. However, if you notice any problems with URLs in different than the US-ASCII encoding, you may try to force the encoding via this initial parameter.

An implementation of the SK.gnome.dwarf.utils.cache.Cache interface may be added to the servlet wrapper in order to speed-up the browsing of large directory trees. However, this will work only if you modify the web files via the WebDAV methods, not by any other way (like FTP, or modifying the files directly on the filesystem).

Two string identifiers can be used in controlling the tracing log messages: "webdav.request" will trace all DAV requests and "webdav.response" will trace all DAV responses. In both cases, the log messages will contain the full XML entity bodies as received from the client and sent by server, so use it only when you really need it.

The servlet stores the property names and values in special directories and files within the web application root directory and its subdirectories. By deleting these files manually you will remove all corresponding properties. Avoid doing that while the servlet is running, as well as modifying these files by hand.
Note: the creationdate property of a resource is set to its last modified time when it is accessed by the servlet for the first time. This is because Java do not provide any regular method for obtaining the creation date of a file.

See Also:
Serialized Form

Field Summary
static int SC_FAILED_DEPENDENCY
          Status code (424) indicating that the requested action depended on another action and that action failed.
static int SC_INSUFFICIENT_STORAGE
          Status code (507) indicating that the server is unable to store the representation needed to successfully complete the request.
static int SC_LOCKED
          Status code (423) indicating that the source or destination resource of a method is locked.
static int SC_MULTISTATUS
          Status code (207) indicating the status for multiple independent operations.
static int SC_PROCESSING
          Status code (102) indicating that the server has accepted the complete request, but has not yet completed it.
static int SC_UNPROCESSABLE_ENTITY
          Status code (422) indicating that the server is not able to process the contained instructions.
 
Constructor Summary
WebDAVServlet()
           
 
Method Summary
protected  void doCopy(Request request, Response response)
           
protected  void doDelete(Request request, Response response)
           
protected  void doLock(Request request, Response response)
           
protected  void doMkcol(Request request, Response response)
           
protected  void doMove(Request request, Response response)
           
protected  void doOptions(Request request, Response response)
           
protected  void doPropfind(Request request, Response response)
           
protected  void doProppatch(Request request, Response response)
           
protected  void doPut(Request request, Response response)
           
protected  void doUnlock(Request request, Response response)
           
 java.lang.String getServletInfo()
           
 void init()
          Initializes the servlet.
protected  void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class SK.gnome.dwarf.http.servlet.FileServlet
doGet, doPost, getLastModified
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPut, doTrace, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SC_PROCESSING

public static final int SC_PROCESSING
Status code (102) indicating that the server has accepted the complete request, but has not yet completed it.

See Also:
Constant Field Values

SC_MULTISTATUS

public static final int SC_MULTISTATUS
Status code (207) indicating the status for multiple independent operations.

See Also:
Constant Field Values

SC_UNPROCESSABLE_ENTITY

public static final int SC_UNPROCESSABLE_ENTITY
Status code (422) indicating that the server is not able to process the contained instructions.

See Also:
Constant Field Values

SC_LOCKED

public static final int SC_LOCKED
Status code (423) indicating that the source or destination resource of a method is locked.

See Also:
Constant Field Values

SC_FAILED_DEPENDENCY

public static final int SC_FAILED_DEPENDENCY
Status code (424) indicating that the requested action depended on another action and that action failed.

See Also:
Constant Field Values

SC_INSUFFICIENT_STORAGE

public static final int SC_INSUFFICIENT_STORAGE
Status code (507) indicating that the server is unable to store the representation needed to successfully complete the request.

See Also:
Constant Field Values
Constructor Detail

WebDAVServlet

public WebDAVServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException
Initializes the servlet.

Overrides:
init in class FileServlet
Throws:
javax.servlet.ServletException - if an error occured

getServletInfo

public java.lang.String getServletInfo()
Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class FileServlet

service

protected void service(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doOptions

protected void doOptions(Request request,
                         Response response)
                  throws javax.servlet.ServletException,
                         java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doPropfind

protected void doPropfind(Request request,
                          Response response)
                   throws javax.servlet.ServletException,
                          java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doProppatch

protected void doProppatch(Request request,
                           Response response)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doMkcol

protected void doMkcol(Request request,
                       Response response)
                throws javax.servlet.ServletException,
                       java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doPut

protected void doPut(Request request,
                     Response response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doDelete

protected void doDelete(Request request,
                        Response response)
                 throws javax.servlet.ServletException,
                        java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doCopy

protected void doCopy(Request request,
                      Response response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doMove

protected void doMove(Request request,
                      Response response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doLock

protected void doLock(Request request,
                      Response response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

doUnlock

protected void doUnlock(Request request,
                        Response response)
                 throws javax.servlet.ServletException,
                        java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.