Package org.alfresco.repo.webdav
Class PropFindMethod
- java.lang.Object
-
- org.alfresco.repo.webdav.WebDAVMethod
-
- org.alfresco.repo.webdav.PropFindMethod
-
- Direct Known Subclasses:
PropPatchMethod
public class PropFindMethod extends WebDAVMethod
Implements the WebDAV PROPFIND method- Author:
- Gavin Cornwell
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.alfresco.repo.webdav.WebDAVMethod
WebDAVMethod.Condition
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
FIND_PROPS
protected static int
GET_ALL_PROPS
protected static int
GET_NAMED_PROPS
protected int
m_mode
protected HashMap<String,String>
m_namespaces
protected ArrayList<WebDAVProperty>
m_properties
-
Fields inherited from class org.alfresco.repo.webdav.WebDAVMethod
logger, m_childToParent, m_conditions, m_davHelper, m_depth, m_parentLockInfo, m_request, m_resourceTag, m_response, m_rootNodeRef, m_strPath, m_userAgent
-
-
Constructor Summary
Constructors Constructor Description PropFindMethod()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected WebDAVProperty
createProperty(Node node)
Creates a WebDAVProperty from the given XML nodeprotected void
executeImpl()
Execute the main WebDAV request processingprotected void
generateAllPropertiesResponse(org.dom4j.io.XMLWriter xml, FileInfo nodeInfo, boolean isDir)
Generates the XML response for a PROPFIND request that asks for all known propertiesprotected void
generateFindPropertiesResponse(org.dom4j.io.XMLWriter xml, FileInfo nodeInfo, boolean isDir)
Generates the XML response for a PROPFIND request that asks for a list of all known propertiesprotected void
generateLockDiscoveryResponse(org.dom4j.io.XMLWriter xml, FileInfo nodeInfo, boolean isDir)
Generates the XML response snippet showing the lock information for the given pathprotected void
generateResponseForNode(org.dom4j.io.XMLWriter xml, FileInfo nodeInfo, String path)
Generates the required response XML for the current nodeint
getMode()
Return the find modeprotected org.dom4j.io.OutputFormat
getXMLOutputFormat()
Returns the format required for an XML response.protected boolean
isReadOnly()
Override and return true if the method is a query method only.protected Map<QName,String>
loadDeadProperties(NodeRef nodeRef)
Loads all dead properties persisted on the nodeprotected void
parseRequestBody()
Parse the request bodyprotected void
parseRequestHeaders()
Parse the request headersprotected void
persistDeadProperties(NodeRef nodeRef, Map<QName,String> deadProperties)
Persists dead properties for specified resourceprotected void
writeLockTypes(org.dom4j.io.XMLWriter xml)
Output the supported lock types XML element-
Methods inherited from class org.alfresco.repo.webdav.WebDAVMethod
checkNode, checkNode, createXMLWriter, execute, flushXML, generateLockDiscoveryXML, generateLockDiscoveryXML, generateNamespaceDeclarations, generateResponseImpl, getActionService, getAuthenticationService, getContentService, getContextPath, getDAVHelper, getDAVLockService, getDepth, getFileFolderService, getMimetypeService, getNamespaceService, getNodeForPath, getNodeLockInfo, getNodeService, getPath, getPermissionService, getRequestBodyAsDocument, getRootNodeRef, getSearchService, getServiceRegistry, getServletPath, getSiteId, getStatusForAccessDeniedException, getTenantDomain, getTransactionService, getURLForPath, getWorkingCopy, parseDepthHeader, parseIfHeader, setDetails, shouldFlushXMLWriter, toString
-
-
-
-
Field Detail
-
GET_ALL_PROPS
protected static final int GET_ALL_PROPS
- See Also:
- Constant Field Values
-
GET_NAMED_PROPS
protected static final int GET_NAMED_PROPS
- See Also:
- Constant Field Values
-
FIND_PROPS
protected static final int FIND_PROPS
- See Also:
- Constant Field Values
-
m_mode
protected int m_mode
-
m_properties
protected ArrayList<WebDAVProperty> m_properties
-
-
Method Detail
-
getMode
public final int getMode()
Return the find mode- Returns:
- int
-
parseRequestHeaders
protected void parseRequestHeaders() throws WebDAVServerException
Parse the request headers- Specified by:
parseRequestHeaders
in classWebDAVMethod
- Throws:
WebDAVServerException
-
parseRequestBody
protected void parseRequestBody() throws WebDAVServerException
Parse the request body- Specified by:
parseRequestBody
in classWebDAVMethod
- Throws:
WebDAVServerException
-
isReadOnly
protected boolean isReadOnly()
Description copied from class:WebDAVMethod
Override and return true if the method is a query method only. The default implementation returns false.- Overrides:
isReadOnly
in classWebDAVMethod
- Returns:
- Returns true always
-
executeImpl
protected void executeImpl() throws WebDAVServerException, Exception
Execute the main WebDAV request processing- Specified by:
executeImpl
in classWebDAVMethod
- Throws:
WebDAVServerException
Exception
- any unhandled exception
-
getXMLOutputFormat
protected org.dom4j.io.OutputFormat getXMLOutputFormat()
Description copied from class:WebDAVMethod
Returns the format required for an XML response. This may vary per method.- Overrides:
getXMLOutputFormat
in classWebDAVMethod
-
createProperty
protected WebDAVProperty createProperty(Node node)
Creates a WebDAVProperty from the given XML node
-
generateResponseForNode
protected void generateResponseForNode(org.dom4j.io.XMLWriter xml, FileInfo nodeInfo, String path) throws Exception
Generates the required response XML for the current node- Parameters:
xml
- XMLWriternodeInfo
- FileInfopath
- String- Throws:
Exception
-
generateAllPropertiesResponse
protected void generateAllPropertiesResponse(org.dom4j.io.XMLWriter xml, FileInfo nodeInfo, boolean isDir) throws Exception
Generates the XML response for a PROPFIND request that asks for all known properties- Parameters:
xml
- XMLWriternodeInfo
- FileInfoisDir
- boolean- Throws:
Exception
-
generateFindPropertiesResponse
protected void generateFindPropertiesResponse(org.dom4j.io.XMLWriter xml, FileInfo nodeInfo, boolean isDir)
Generates the XML response for a PROPFIND request that asks for a list of all known properties- Parameters:
xml
- XMLWriternodeInfo
- FileInfoisDir
- boolean
-
generateLockDiscoveryResponse
protected void generateLockDiscoveryResponse(org.dom4j.io.XMLWriter xml, FileInfo nodeInfo, boolean isDir) throws Exception
Generates the XML response snippet showing the lock information for the given path- Parameters:
xml
- XMLWriternodeInfo
- FileInfoisDir
- boolean- Throws:
Exception
-
writeLockTypes
protected void writeLockTypes(org.dom4j.io.XMLWriter xml)
Output the supported lock types XML element- Parameters:
xml
- XMLWriter
-
loadDeadProperties
protected Map<QName,String> loadDeadProperties(NodeRef nodeRef)
Loads all dead properties persisted on the node- Parameters:
nodeRef
- NodeRef- Returns:
- the map of all dead properties
-
-