Class LockMethod


  • public class LockMethod
    extends WebDAVMethod
    Implements the WebDAV LOCK method
    Author:
    gavinc
    • Field Detail

      • m_timeoutDuration

        protected int m_timeoutDuration
      • lockInfo

        protected org.alfresco.repo.webdav.LockInfo lockInfo
      • createExclusive

        protected boolean createExclusive
      • lockToken

        protected java.lang.String lockToken
    • Constructor Detail

      • LockMethod

        public LockMethod()
        Default constructor
    • Method Detail

      • hasLockToken

        protected final boolean hasLockToken()
        Returns true if request has lock token in the If header
        Returns:
        boolean
      • getLockTimeout

        protected final int getLockTimeout()
        Return the lock timeout, in seconds.
        Returns:
        int
      • createNode

        protected org.alfresco.service.cmr.model.FileInfo createNode​(org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
                                                                     java.lang.String name,
                                                                     org.alfresco.service.namespace.QName typeQName)
        Create a new node
        Parameters:
        parentNodeRef - the parent node.
        name - the name of the node
        typeQName - the type to create
        Returns:
        Returns the new node's file information
      • createLock

        protected final void createLock​(org.alfresco.service.cmr.model.FileInfo lockNode,
                                        java.lang.String userName)
                                 throws WebDAVServerException
        Create a new lock
        Parameters:
        lockNode - NodeRef
        userName - String
        Throws:
        WebDAVServerException
      • refreshLock

        protected final void refreshLock​(org.alfresco.service.cmr.model.FileInfo lockNode,
                                         java.lang.String userName)
                                  throws WebDAVServerException
        Refresh an existing lock
        Parameters:
        lockNode - NodeRef
        userName - String
        Throws:
        WebDAVServerException
      • generateResponse

        protected void generateResponse​(org.alfresco.service.cmr.model.FileInfo lockNodeInfo,
                                        java.lang.String userName)
                                 throws java.lang.Exception
        Generates the XML lock discovery response body
        Throws:
        java.lang.Exception
      • generateNamespaceDeclarations

        protected java.lang.String generateNamespaceDeclarations​(java.util.HashMap<java.lang.String,​java.lang.String> nameSpaces)
        Generates a list of namespace declarations for the response
        Overrides:
        generateNamespaceDeclarations in class WebDAVMethod