Class LockDiscovery

All Implemented Interfaces:
DavConstants, DavProperty<List<ActiveLock>>, PropEntry, XmlSerializable

public class LockDiscovery extends AbstractDavProperty<List<ActiveLock>>
The LockDiscovery class encapsulates the webdav lock discovery property that is sent in the request body (PROPFIND and LOCK) and received in a LOCK response body.
  • Constructor Details

    • LockDiscovery

      public LockDiscovery()
      Creates a new empty LockDiscovery property
    • LockDiscovery

      public LockDiscovery(ActiveLock lock)
      Create a new LockDiscovery property
      Parameters:
      lock -
    • LockDiscovery

      public LockDiscovery(ActiveLock[] locks)
      Create a new LockDiscovery property
      Parameters:
      locks -
  • Method Details

    • getValue

      public List<ActiveLock> getValue()
      Returns the list of active locks.
      Returns:
      list of active locks
      See Also:
    • toXml

      public Element toXml(Document document)
      Creates a <lockdiscovery> element in response to a LOCK request or to the lockdiscovery property of a PROPFIND request.
      NOTE: if the activeLocks list is empty an empty lockdiscovery property is created ( <lockdiscovery/>)
      Specified by:
      toXml in interface XmlSerializable
      Overrides:
      toXml in class AbstractDavProperty<List<ActiveLock>>
      Parameters:
      document -
      Returns:
      A <lockdiscovery> element.
      See Also:
    • createFromXml

      public static LockDiscovery createFromXml(Element lockDiscoveryElement)
      Builds a new LockDiscovery object from the given xml element.
      Parameters:
      lockDiscoveryElement -
      Returns:
      Throws:
      IllegalArgumentException - if the given xml element is not a DAV:lockdiscovery element.