com.jalios.jcms.webdav
Class WebdavManager

java.lang.Object
  extended by com.jalios.jcms.webdav.WebdavManager

public class WebdavManager
extends Object

This class is called by WebdavServlet to handle all webdav protocole. It handle all method declaration, delegate to WebdavFileSystem, then send back a response.

Since:
jcms-5.5.0
Version:
$Revision: 38095 $
Author:
Jean-Philippe Encausse

Field Summary
static String REVISION
           
 
Constructor Summary
WebdavManager()
           
 
Method Summary
protected  void doCopy(WebdavContext ctxt)
          COPY Method If writing is allowed, This method decode HTTP Headers: destinationHeader, path, ovewrite Then call doCopy from WebdavFileSystem
protected  void doDelete(WebdavContext ctxt)
          DELETE Method.
protected  void doGet(WebdavContext ctxt, boolean printContent)
          GET Method.
protected  void doHead(WebdavContext ctxt)
          HEAD Method.
protected  void doLock(WebdavContext ctxt)
          LOCK Method.
protected  void doMkcol(WebdavContext ctxt)
          MKCOL Method.
protected  void doMove(WebdavContext ctxt)
          MOVE Method.
protected  void doOption(WebdavContext ctxt)
          OPTION Method.
Update headers with really custom argument: "Pragma" -> "no-cache" "Cache-Control" -> "no-store, no-cache, must-revalidate" "Cache-Control" -> "post-check=0, pre-check=0" "MS-Author-Via" -> "DAV, MS-FP/4.0" "MicrosoftOfficeWebServer" -> "5.0_Pub" "DAV" -> "1, 2, DAVJCMS, access-control"
protected  void doPropfind(WebdavContext ctxt)
          PROPFIND Method.
protected  Collection<WebdavProperty> doPropfindByProperty(com.jalios.jcms.webdav.WebdavManager.PropFindType type, org.jdom.Element propNode)
          If type is FIND_BY_PROPERTY This method will return a list of Properties for the given Property Node
protected  void doProppatch(WebdavContext ctxt)
          PROPPATCH Method: Not Implemented Create/Delete a resource property on a non locked resource
WARNING! This methods use in Memory Property management and has no been correctly tested with litmus because JCMS should not use it.
protected  void doPut(WebdavContext ctxt)
          PUT Method.
protected  void doUnlock(WebdavContext ctxt)
          UNLOCK Method.
protected  String getMethodsAllowed(WebdavResource res, WebdavContext ctxt)
           
protected  org.jdom.Element getPropNode(WebdavContext ctxt)
          Return the PropertyNode from the XML Document
protected  com.jalios.jcms.webdav.WebdavManager.PropFindType getPropNodeType(org.jdom.Element propNode)
          This method will parse Property Node Then decode the type of property to display.
 boolean handleWebdavRequest(WebdavContext ctxt)
          This method handle the HTTP Request then redirect to the right method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

WebdavManager

public WebdavManager()
Method Detail

handleWebdavRequest

public boolean handleWebdavRequest(WebdavContext ctxt)
                            throws IOException
This method handle the HTTP Request then redirect to the right method.

Parameters:
ctxt - The WebdavContext
Returns:
booleant true if the method has been found
Throws:
IOException

getPropNode

protected org.jdom.Element getPropNode(WebdavContext ctxt)
Return the PropertyNode from the XML Document

Parameters:
ctxt - the WegbdavContext
Returns:
Node an XML Node

getPropNodeType

protected com.jalios.jcms.webdav.WebdavManager.PropFindType getPropNodeType(org.jdom.Element propNode)
This method will parse Property Node Then decode the type of property to display.

Parameters:
propNode - the XML Document Node to parse
Returns:
int the type of Property

doPropfindByProperty

protected Collection<WebdavProperty> doPropfindByProperty(com.jalios.jcms.webdav.WebdavManager.PropFindType type,
                                                          org.jdom.Element propNode)
If type is FIND_BY_PROPERTY This method will return a list of Properties for the given Property Node

Parameters:
type - the property type
propNode - the XML Document Node to parse
Returns:
Collection a list of properties to work with

getMethodsAllowed

protected String getMethodsAllowed(WebdavResource res,
                                   WebdavContext ctxt)
Parameters:
res - the WebdavResource
ctxt - the Webdav Context
Returns:
String a list of allowed Webdav Methods

doPropfind

protected void doPropfind(WebdavContext ctxt)
                   throws javax.servlet.ServletException,
                          IOException
PROPFIND Method. If listing is allowed, This method decode HTTP Headers: path, depth, type of propeties Then return an XML of properties of the given type for a given path and subpath at a given depth

Parameters:
ctxt - the Webdav Context
Throws:
javax.servlet.ServletException
IOException

doProppatch

protected void doProppatch(WebdavContext ctxt)
                    throws javax.servlet.ServletException,
                           IOException
PROPPATCH Method: Not Implemented Create/Delete a resource property on a non locked resource
WARNING! This methods use in Memory Property management and has no been correctly tested with litmus because JCMS should not use it. For 1st version of JCMS Webdav Module.

Parameters:
ctxt - the Webdav Context
Throws:
javax.servlet.ServletException
IOException

doMkcol

protected void doMkcol(WebdavContext ctxt)
                throws javax.servlet.ServletException,
                       IOException
MKCOL Method. Create new Collection. No ovewrite if one already exists.

Parameters:
ctxt - the Webdav Context
Throws:
javax.servlet.ServletException
IOException

doDelete

protected void doDelete(WebdavContext ctxt)
                 throws javax.servlet.ServletException,
                        IOException
DELETE Method. Then call doDelete from WebdavFileSystem to recursively resources.

Parameters:
ctxt - the Webdav Context
Throws:
javax.servlet.ServletException
IOException

doCopy

protected void doCopy(WebdavContext ctxt)
               throws javax.servlet.ServletException,
                      IOException
COPY Method If writing is allowed, This method decode HTTP Headers: destinationHeader, path, ovewrite Then call doCopy from WebdavFileSystem

Parameters:
ctxt - the Webdav Context
Throws:
javax.servlet.ServletException
IOException

doMove

protected void doMove(WebdavContext ctxt)
               throws javax.servlet.ServletException,
                      IOException
MOVE Method. Decode Parameters then call WebdavFileSystem.move()

Parameters:
ctxt - the Webdav Context
Throws:
javax.servlet.ServletException
IOException

doGet

protected void doGet(WebdavContext ctxt,
                     boolean printContent)
              throws javax.servlet.ServletException,
                     IOException
GET Method.

Parameters:
ctxt - the Webdav Context
printContent - GET or HEAD ?
Throws:
javax.servlet.ServletException
IOException

doHead

protected void doHead(WebdavContext ctxt)
               throws javax.servlet.ServletException,
                      IOException
HEAD Method.

Parameters:
ctxt - the Webdav Context
Throws:
javax.servlet.ServletException
IOException

doPut

protected void doPut(WebdavContext ctxt)
              throws javax.servlet.ServletException,
                     IOException
PUT Method. A PUT that would result in the creation of a resource without an appropriately scoped parent collection MUST fail with a 409(Conflict).

Parameters:
ctxt - the Webdav Context
Throws:
javax.servlet.ServletException
IOException

doLock

protected void doLock(WebdavContext ctxt)
               throws javax.servlet.ServletException,
                      IOException
LOCK Method.

Parameters:
ctxt - the Webdav Context
Throws:
javax.servlet.ServletException
IOException

doUnlock

protected void doUnlock(WebdavContext ctxt)
                 throws javax.servlet.ServletException,
                        IOException
UNLOCK Method.

Parameters:
ctxt - the Webdav Context
Throws:
javax.servlet.ServletException
IOException

doOption

protected void doOption(WebdavContext ctxt)
                 throws javax.servlet.ServletException,
                        IOException
OPTION Method.
Update headers with really custom argument:

Parameters:
ctxt - the Webdav Context
Throws:
javax.servlet.ServletException
IOException


Copyright © 2001-2010 Jalios SA. All Rights Reserved.