mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-08 04:08:12 -05:00
Dav: implement multivalued property suppord in ExchangeDavMethod
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2022 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
c5a7918843
commit
59f752acf4
@ -178,6 +178,9 @@ public abstract class ExchangeDavMethod extends PostMethod {
|
|||||||
if (XMLStreamUtil.isStartTag(reader)) {
|
if (XMLStreamUtil.isStartTag(reader)) {
|
||||||
Namespace namespace = Namespace.getNamespace(reader.getNamespaceURI());
|
Namespace namespace = Namespace.getNamespace(reader.getNamespaceURI());
|
||||||
String tagLocalName = reader.getLocalName();
|
String tagLocalName = reader.getLocalName();
|
||||||
|
if (reader.getAttributeCount() > 0 && "mv.string".equals(reader.getAttributeValue(0))) {
|
||||||
|
handleMultiValuedProperty(reader, multiStatusResponse);
|
||||||
|
} else {
|
||||||
String tagContent = getTagContent(reader);
|
String tagContent = getTagContent(reader);
|
||||||
if (tagContent != null) {
|
if (tagContent != null) {
|
||||||
multiStatusResponse.add(new DefaultDavProperty(tagLocalName, tagContent, namespace));
|
multiStatusResponse.add(new DefaultDavProperty(tagLocalName, tagContent, namespace));
|
||||||
@ -185,6 +188,23 @@ public abstract class ExchangeDavMethod extends PostMethod {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void handleMultiValuedProperty(XMLStreamReader reader, MultiStatusResponse multiStatusResponse) throws XMLStreamException {
|
||||||
|
String tagLocalName = reader.getLocalName();
|
||||||
|
Namespace namespace = Namespace.getNamespace(reader.getNamespaceURI());
|
||||||
|
ArrayList<String> values = new ArrayList<String>();
|
||||||
|
while (reader.hasNext() && !XMLStreamUtil.isEndTag(reader, tagLocalName)) {
|
||||||
|
reader.next();
|
||||||
|
if (XMLStreamUtil.isStartTag(reader)) {
|
||||||
|
String tagContent = getTagContent(reader);
|
||||||
|
if (tagContent != null) {
|
||||||
|
values.add(tagContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
multiStatusResponse.add(new DefaultDavProperty(tagLocalName, values, namespace));
|
||||||
|
}
|
||||||
|
|
||||||
protected String getTagContent(XMLStreamReader reader) throws XMLStreamException {
|
protected String getTagContent(XMLStreamReader reader) throws XMLStreamException {
|
||||||
String value = null;
|
String value = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user