Package com.jalios.jcms.webdav
Class WebdavManager
- java.lang.Object
 - 
- com.jalios.jcms.webdav.WebdavManager
 
 
- 
public class WebdavManager extends java.lang.ObjectThis 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: 107554 $
 - Author:
 - Jean-Philippe Encausse
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringREVISION 
- 
Constructor Summary
Constructors Constructor Description WebdavManager() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoCopy(WebdavContext ctxt)COPY Method If writing is allowed, This method decode HTTP Headers: destinationHeader, path, ovewrite Then call doCopy from WebdavFileSystemprotected voiddoDelete(WebdavContext ctxt)DELETE Method.protected voiddoGet(WebdavContext ctxt, boolean printContent)GET Method.protected voiddoHead(WebdavContext ctxt)HEAD Method.protected voiddoLock(WebdavContext ctxt)LOCK Method.protected voiddoMkcol(WebdavContext ctxt)MKCOL Method.protected voiddoMove(WebdavContext ctxt)MOVE Method.protected voiddoOption(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 voiddoPropfind(WebdavContext ctxt)PROPFIND Method.protected java.util.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 Nodeprotected voiddoProppatch(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 voiddoPut(WebdavContext ctxt)PUT Method.protected voiddoUnlock(WebdavContext ctxt)UNLOCK Method.protected java.lang.StringgetMethodsAllowed(WebdavResource res, WebdavContext ctxt)protected org.jdom.ElementgetPropNode(WebdavContext ctxt)Return the PropertyNode from the XML Documentprotected com.jalios.jcms.webdav.WebdavManager.PropFindTypegetPropNodeType(org.jdom.Element propNode)This method will parse Property Node Then decode the type of property to display.booleanhandleWebdavRequest(WebdavContext ctxt)This method handle the HTTP Request then redirect to the right method. 
 - 
 
- 
- 
Field Detail
- 
REVISION
public static final java.lang.String REVISION
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Method Detail
- 
handleWebdavRequest
public boolean handleWebdavRequest(WebdavContext ctxt) throws java.io.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:
 java.io.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 java.util.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 typepropNode- the XML Document Node to parse- Returns:
 - Collection a list of properties to work with
 
 
- 
getMethodsAllowed
protected java.lang.String getMethodsAllowed(WebdavResource res, WebdavContext ctxt)
- Parameters:
 res- the WebdavResourcectxt- the Webdav Context- Returns:
 - String a list of allowed Webdav Methods
 
 
- 
doPropfind
protected void doPropfind(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.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.ServletExceptionjava.io.IOException
 
- 
doProppatch
protected void doProppatch(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.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.ServletExceptionjava.io.IOException
 
- 
doMkcol
protected void doMkcol(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.IOException
MKCOL Method. Create new Collection. No ovewrite if one already exists.- Parameters:
 ctxt- the Webdav Context- Throws:
 javax.servlet.ServletExceptionjava.io.IOException
 
- 
doDelete
protected void doDelete(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.IOException
DELETE Method. Then call doDelete from WebdavFileSystem to recursively resources.- Parameters:
 ctxt- the Webdav Context- Throws:
 javax.servlet.ServletExceptionjava.io.IOException
 
- 
doCopy
protected void doCopy(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.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.ServletExceptionjava.io.IOException
 
- 
doMove
protected void doMove(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.IOException
MOVE Method. Decode Parameters then call WebdavFileSystem.move()- Parameters:
 ctxt- the Webdav Context- Throws:
 javax.servlet.ServletExceptionjava.io.IOException
 
- 
doGet
protected void doGet(WebdavContext ctxt, boolean printContent) throws javax.servlet.ServletException, java.io.IOException
GET Method.- Parameters:
 ctxt- the Webdav ContextprintContent- GET or HEAD ?- Throws:
 javax.servlet.ServletExceptionjava.io.IOException
 
- 
doHead
protected void doHead(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.IOException
HEAD Method.- Parameters:
 ctxt- the Webdav Context- Throws:
 javax.servlet.ServletExceptionjava.io.IOException
 
- 
doPut
protected void doPut(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.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.ServletExceptionjava.io.IOException
 
- 
doLock
protected void doLock(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.IOException
LOCK Method.- Parameters:
 ctxt- the Webdav Context- Throws:
 javax.servlet.ServletExceptionjava.io.IOException
 
- 
doUnlock
protected void doUnlock(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.IOException
UNLOCK Method.- Parameters:
 ctxt- the Webdav Context- Throws:
 javax.servlet.ServletExceptionjava.io.IOException
 
- 
doOption
protected void doOption(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.IOException
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"
 
- Parameters:
 ctxt- the Webdav Context- Throws:
 javax.servlet.ServletExceptionjava.io.IOException
 
 - 
 
 -