Tabnine Logo
LockDiscovery.createFromXml
Code IndexAdd Tabnine to your IDE (free)

How to use
createFromXml
method
in
org.apache.jackrabbit.webdav.lock.LockDiscovery

Best Java code snippets using org.apache.jackrabbit.webdav.lock.LockDiscovery.createFromXml (Showing top 4 results out of 315)

origin: apache/jackrabbit

/**
 * Return response body as {@link LockDiscovery} object.
 * @throws IllegalStateException when response does not represent a {@link LockDiscovery}
 * @throws DavException for failures in obtaining/parsing the response body
 */
public LockDiscovery getResponseBodyAsLockDiscovery(HttpResponse response) throws DavException {
  try {
    Document doc = getResponseBodyAsDocument(response.getEntity());
    if (doc == null) {
      throw new DavException(response.getStatusLine().getStatusCode(), "no response body");
    }
    Element root = doc.getDocumentElement();
    if (!DomUtil.matches(root, DavConstants.XML_PROP, DavConstants.NAMESPACE)
        && DomUtil.hasChildElement(root, DavConstants.PROPERTY_LOCKDISCOVERY, DavConstants.NAMESPACE)) {
      throw new DavException(response.getStatusLine().getStatusCode(),
          "Missing DAV:prop response body in LOCK response.");
    }
    Element lde = DomUtil.getChildElement(root, DavConstants.PROPERTY_LOCKDISCOVERY, DavConstants.NAMESPACE);
    if (!DomUtil.hasChildElement(lde, DavConstants.XML_ACTIVELOCK, DavConstants.NAMESPACE)) {
      throw new DavException(response.getStatusLine().getStatusCode(),
          "The DAV:lockdiscovery must contain a least a single DAV:activelock in response to a successful LOCK request.");
    }
    return LockDiscovery.createFromXml(lde);
  } catch (IOException ex) {
    throw new DavException(response.getStatusLine().getStatusCode(), ex);
  }
}
origin: org.apache.jackrabbit/jackrabbit-webdav

/**
 * Return response body as {@link LockDiscovery} object.
 * @throws IllegalStateException when response does not represent a {@link LockDiscovery}
 * @throws DavException for failures in obtaining/parsing the response body
 */
public LockDiscovery getResponseBodyAsLockDiscovery(HttpResponse response) throws DavException {
  try {
    Document doc = getResponseBodyAsDocument(response.getEntity());
    if (doc == null) {
      throw new DavException(response.getStatusLine().getStatusCode(), "no response body");
    }
    Element root = doc.getDocumentElement();
    if (!DomUtil.matches(root, DavConstants.XML_PROP, DavConstants.NAMESPACE)
        && DomUtil.hasChildElement(root, DavConstants.PROPERTY_LOCKDISCOVERY, DavConstants.NAMESPACE)) {
      throw new DavException(response.getStatusLine().getStatusCode(),
          "Missing DAV:prop response body in LOCK response.");
    }
    Element lde = DomUtil.getChildElement(root, DavConstants.PROPERTY_LOCKDISCOVERY, DavConstants.NAMESPACE);
    if (!DomUtil.hasChildElement(lde, DavConstants.XML_ACTIVELOCK, DavConstants.NAMESPACE)) {
      throw new DavException(response.getStatusLine().getStatusCode(),
          "The DAV:lockdiscovery must contain a least a single DAV:activelock in response to a successful LOCK request.");
    }
    return LockDiscovery.createFromXml(lde);
  } catch (IOException ex) {
    throw new DavException(response.getStatusLine().getStatusCode(), ex);
  }
}
origin: org.apache.jackrabbit/jackrabbit-spi2dav

if (ps.contains(DavPropertyName.LOCKDISCOVERY)) {
  DavProperty<?> p = ps.get(DavPropertyName.LOCKDISCOVERY);
  LockDiscovery ld = LockDiscovery.createFromXml(p.toXml(DomUtil.createDocument()));
  NodeId parentId = getParentId(uri, ps, sessionInfo);
  return retrieveLockInfo(ld, sessionInfo, nodeId, parentId);
origin: apache/jackrabbit

if (ps.contains(DavPropertyName.LOCKDISCOVERY)) {
  DavProperty<?> p = ps.get(DavPropertyName.LOCKDISCOVERY);
  LockDiscovery ld = LockDiscovery.createFromXml(p.toXml(DomUtil.createDocument()));
  NodeId parentId = getParentId(uri, ps, sessionInfo);
  return retrieveLockInfo(ld, sessionInfo, nodeId, parentId);
org.apache.jackrabbit.webdav.lockLockDiscoverycreateFromXml

Javadoc

Builds a new LockDiscovery object from the given xml element.

Popular methods of LockDiscovery

  • <init>
    Create a new LockDiscovery property
  • addActiveLock
  • getName
  • getValue
    Returns the list of active locks.

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • compareTo (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • String (java.lang)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JTextField (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now