Class MergeInfo
- java.lang.Object
-
- org.apache.jackrabbit.webdav.version.MergeInfo
-
- All Implemented Interfaces:
DeltaVConstants
,XmlSerializable
public class MergeInfo extends java.lang.Object implements DeltaVConstants, XmlSerializable
MergeInfo
encapsulates the information present in the DAV:merge element, that forms the mandatory request body of a MERGE request.
The DAV:merge element is specified to have the following form.<!ELEMENT merge ANY> ANY value: A sequence of elements with one DAV:source element, at most one DAV:no-auto-merge element, at most one DAV:no-checkout element, at most one DAV:prop element, and any legal set of elements that can occur in a DAV:checkout element. <!ELEMENT source (href+)> <!ELEMENT no-auto-merge EMPTY> <!ELEMENT no-checkout EMPTY> prop: see RFC 2518, Section 12.11
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.webdav.version.DeltaVConstants
ATTR_NAME, ATTR_NAMESPACE, COMMENT, CREATOR_DISPLAYNAME, HEADER_LABEL, HEADER_LOCATION, NAMESPACE, SUPPORTED_LIVE_PROPERTY_SET, SUPPORTED_METHOD_SET, SUPPORTED_REPORT_SET, VERSION_CONTROLLED_CONFIGURATION, WORKSPACE, XML_ACTIVITY, XML_ACTIVITY_COLLECTION_SET, XML_BASELINE, XML_CHECKOUT, XML_CHECKOUT_CHECKIN, XML_CHECKOUT_UNLOCK_CHECKIN, XML_EXPAND_PROPERTY, XML_LABEL, XML_LABEL_ADD, XML_LABEL_NAME, XML_LABEL_REMOVE, XML_LABEL_SET, XML_LOCATE_BY_HISTORY, XML_LOCKED_CHECKIN, XML_MERGE, XML_N0_AUTO_MERGE, XML_N0_CHECKOUT, XML_OPTIONS, XML_OPTIONS_RESPONSE, XML_PROPERTY, XML_REPORT, XML_SUPPORTED_METHOD, XML_SUPPORTED_REPORT, XML_UPDATE, XML_VERSION, XML_VERSION_HISTORY, XML_VERSION_HISTORY_SET, XML_VERSION_TREE, XML_VH_COLLECTION_SET, XML_WORKSPACE, XML_WSP_COLLECTION_SET
-
-
Constructor Summary
Constructors Constructor Description MergeInfo(org.w3c.dom.Element mergeElement)
Create a newMergeInfo
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.w3c.dom.Element
createMergeElement(java.lang.String[] mergeSource, boolean isNoAutoMerge, boolean isNoCheckout, org.w3c.dom.Document factory)
Factory method to create a minimal DAV:merge element to create a newMergeInfo
object.org.w3c.dom.Element
getMergeElement()
Returns the DAV:merge element used to create thisMergeInfo
object.DavPropertyNameSet
getPropertyNameSet()
Returns aDavPropertyNameSet
.java.lang.String[]
getSourceHrefs()
Returns the URL specified with the DAV:source element ornull
if no such child element is present in the DAV:merge element.boolean
isNoAutoMerge()
Returns true if the DAV:merge element contains a DAV:no-auto-merge child element.boolean
isNoCheckout()
Returns true if the DAV:merge element contains a DAV:no-checkout child element.org.w3c.dom.Element
toXml(org.w3c.dom.Document document)
Returns the xml representation of the implementing object asElement
.
-
-
-
Constructor Detail
-
MergeInfo
public MergeInfo(org.w3c.dom.Element mergeElement) throws DavException
Create a newMergeInfo
- Parameters:
mergeElement
-- Throws:
DavException
- if the mergeElement isnull
or not a DAV:merge element.
-
-
Method Detail
-
getSourceHrefs
public java.lang.String[] getSourceHrefs()
Returns the URL specified with the DAV:source element ornull
if no such child element is present in the DAV:merge element.- Returns:
- href present in the DAV:source child element or
null
.
-
isNoAutoMerge
public boolean isNoAutoMerge()
Returns true if the DAV:merge element contains a DAV:no-auto-merge child element.- Returns:
- true if the DAV:merge element contains a DAV:no-auto-merge child.
-
isNoCheckout
public boolean isNoCheckout()
Returns true if the DAV:merge element contains a DAV:no-checkout child element.- Returns:
- true if the DAV:merge element contains a DAV:no-checkout child
-
getPropertyNameSet
public DavPropertyNameSet getPropertyNameSet()
Returns aDavPropertyNameSet
. If the DAV:merge element contains a DAV:prop child element the properties specified therein are included in the set. Otherwise an empty set is returned.
WARNING: modifying the DavPropertyNameSet returned by this method does not modify thisUpdateInfo
.- Returns:
- set listing the properties specified in the DAV:prop element indicating those properties that must be reported in the response body.
-
getMergeElement
public org.w3c.dom.Element getMergeElement()
Returns the DAV:merge element used to create thisMergeInfo
object.- Returns:
- DAV:merge element
-
toXml
public org.w3c.dom.Element toXml(org.w3c.dom.Document document)
Description copied from interface:XmlSerializable
Returns the xml representation of the implementing object asElement
. The givenDocument
is used as factory and represents theowner document
of the returned DOM element.- Specified by:
toXml
in interfaceXmlSerializable
- Parameters:
document
-- Returns:
- a w3c element representing this object
- See Also:
XmlSerializable.toXml(Document)
-
createMergeElement
public static org.w3c.dom.Element createMergeElement(java.lang.String[] mergeSource, boolean isNoAutoMerge, boolean isNoCheckout, org.w3c.dom.Document factory)
Factory method to create a minimal DAV:merge element to create a newMergeInfo
object.- Parameters:
mergeSource
-isNoAutoMerge
-isNoCheckout
-factory
-- Returns:
-
-