com.caucho.servlets.webdav
Class WebDavServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by com.caucho.servlets.webdav.WebDavServlet
All Implemented Interfaces:
java.io.Serializable, Servlet, ServletConfig

public class WebDavServlet
extends GenericServlet

Serves the WebDAV protocol. The underlying AbstractPath controls the actual files served and modified. The default AbstractPath just uses getRealPath from the current ServletContext.

More sophisticated users can customize AbstractPath to provide their own WebDAV view for their objects, much like the Linux /proc filesystem provides a view to Linux kernel modules.

 <resource-ref res-ref-name='resin/webdav'>
   <class-name>test.foo.MyDataSource</class-name>
   <init-param my-foo='bar'/>
 </resource-ref>

 <servlet-mapping url-pattern='/webdav/*'
                  servlet-name='com.caucho.http.webdav.WebDavServlet'>
   <init-param enable='write'/>
   <init-param path-source='resin/webdav'/>
 </servlet-mapping>
 

See Also:
Serialized Form

Constructor Summary
WebDavServlet()
           
 
Method Summary
 void destroy()
          Called when the servlet (and the application) shuts down.
protected  java.lang.String getParent(java.lang.String pathInfo)
           
 void init()
          Initialize the servlet.
protected  java.lang.String lookup(java.lang.String parent, java.lang.String child)
           
protected  void sendError(HttpServletResponse res, WriteStream out, int status, java.lang.String statusText, java.lang.String message)
           
 void service(ServletRequest request, ServletResponse response)
          Service the webdav request.
 void setCrLf(boolean addCrLf)
          Sets true if should add cr/lf
 void setEnable(java.lang.String enable)
          Sets the enable value.
 void setPathSource(AbstractPath path)
          Sets the path.
 void setRole(java.lang.String role)
          Sets the allowed role.
 void setRoot(java.lang.String root)
          Sets the root.
 void setSecure(boolean needsSecure)
          Set true for securted.
 void setUser(java.lang.String user)
          Sets the allowed user.
protected  void startMultistatus(HttpServletResponse res, WriteStream out)
           
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebDavServlet

public WebDavServlet()
Method Detail

setEnable

public void setEnable(java.lang.String enable)
Sets the enable value.


setRole

public void setRole(java.lang.String role)
Sets the allowed role.


setUser

public void setUser(java.lang.String user)
Sets the allowed user.


setSecure

public void setSecure(boolean needsSecure)
Set true for securted.


setPathSource

public void setPathSource(AbstractPath path)
Sets the path.


setRoot

public void setRoot(java.lang.String root)
Sets the root.


setCrLf

public void setCrLf(boolean addCrLf)
Sets true if should add cr/lf


init

public void init()
          throws ServletException
Description copied from class: GenericServlet
Initialize the servlet. Servlets should override this method if they need any initialization like opening pooled database connections.

Overrides:
init in class GenericServlet
Throws:
ServletException

service

public void service(ServletRequest request,
                    ServletResponse response)
             throws ServletException,
                    java.io.IOException
Service the webdav request.

Parameters:
request - request information. Normally servlets will cast this to HttpServletRequest
response - response information. Normally servlets will cast this to HttpServletRequest
Throws:
ServletException
java.io.IOException

startMultistatus

protected void startMultistatus(HttpServletResponse res,
                                WriteStream out)
                         throws java.io.IOException
Throws:
java.io.IOException

sendError

protected void sendError(HttpServletResponse res,
                         WriteStream out,
                         int status,
                         java.lang.String statusText,
                         java.lang.String message)
                  throws java.io.IOException
Throws:
java.io.IOException

getParent

protected java.lang.String getParent(java.lang.String pathInfo)

lookup

protected java.lang.String lookup(java.lang.String parent,
                                  java.lang.String child)

destroy

public void destroy()
Description copied from class: GenericServlet
Called when the servlet (and the application) shuts down.

Specified by:
destroy in interface Servlet
Overrides:
destroy in class GenericServlet