mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-05 18:58:02 -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,14 +178,34 @@ public abstract class ExchangeDavMethod extends PostMethod {
|
||||
if (XMLStreamUtil.isStartTag(reader)) {
|
||||
Namespace namespace = Namespace.getNamespace(reader.getNamespaceURI());
|
||||
String tagLocalName = reader.getLocalName();
|
||||
String tagContent = getTagContent(reader);
|
||||
if (tagContent != null) {
|
||||
multiStatusResponse.add(new DefaultDavProperty(tagLocalName, tagContent, namespace));
|
||||
if (reader.getAttributeCount() > 0 && "mv.string".equals(reader.getAttributeValue(0))) {
|
||||
handleMultiValuedProperty(reader, multiStatusResponse);
|
||||
} else {
|
||||
String tagContent = getTagContent(reader);
|
||||
if (tagContent != null) {
|
||||
multiStatusResponse.add(new DefaultDavProperty(tagLocalName, tagContent, namespace));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
String value = null;
|
||||
String tagLocalName = reader.getLocalName();
|
||||
|
Loading…
Reference in New Issue
Block a user