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
- Author:
- Jean-Philippe Encausse
 
- 
- 
Constructor SummaryConstructors Constructor Description WebdavManager()
 - 
Method SummaryAll 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.
 
- 
- 
- 
Method Detail- 
handleWebdavRequestpublic 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
 
 - 
getPropNodeprotected org.jdom.Element getPropNode(WebdavContext ctxt) Return the PropertyNode from the XML Document- Parameters:
- ctxt- the WegbdavContext
- Returns:
- Node an XML Node
 
 - 
getPropNodeTypeprotected 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
 
 - 
doPropfindByPropertyprotected 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 type
- propNode- the XML Document Node to parse
- Returns:
- Collection a list of properties to work with
 
 - 
getMethodsAllowedprotected java.lang.String getMethodsAllowed(WebdavResource res, WebdavContext ctxt) - Parameters:
- res- the WebdavResource
- ctxt- the Webdav Context
- Returns:
- String a list of allowed Webdav Methods
 
 - 
doPropfindprotected 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.ServletException
- java.io.IOException
 
 - 
doProppatchprotected 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.ServletException
- java.io.IOException
 
 - 
doMkcolprotected 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.ServletException
- java.io.IOException
 
 - 
doDeleteprotected 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.ServletException
- java.io.IOException
 
 - 
doCopyprotected 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.ServletException
- java.io.IOException
 
 - 
doMoveprotected 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.ServletException
- java.io.IOException
 
 - 
doGetprotected void doGet(WebdavContext ctxt, boolean printContent) throws javax.servlet.ServletException, java.io.IOException GET Method.- Parameters:
- ctxt- the Webdav Context
- printContent- GET or HEAD ?
- Throws:
- javax.servlet.ServletException
- java.io.IOException
 
 - 
doHeadprotected void doHead(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.IOException HEAD Method.- Parameters:
- ctxt- the Webdav Context
- Throws:
- javax.servlet.ServletException
- java.io.IOException
 
 - 
doPutprotected 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.ServletException
- java.io.IOException
 
 - 
doLockprotected void doLock(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.IOException LOCK Method.- Parameters:
- ctxt- the Webdav Context
- Throws:
- javax.servlet.ServletException
- java.io.IOException
 
 - 
doUnlockprotected void doUnlock(WebdavContext ctxt) throws javax.servlet.ServletException, java.io.IOException UNLOCK Method.- Parameters:
- ctxt- the Webdav Context
- Throws:
- javax.servlet.ServletException
- java.io.IOException
 
 - 
doOptionprotected 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.ServletException
- java.io.IOException
 
 
- 
 
-