2010-06-07 17:19:09 -04:00
|
|
|
/*
|
|
|
|
* DavMail POP/IMAP/SMTP/CalDav/LDAP Exchange Gateway
|
|
|
|
* Copyright (C) 2010 Mickael Guessant
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
package davmail.exchange.ews;
|
|
|
|
|
2010-07-20 11:00:48 -04:00
|
|
|
import davmail.util.StringUtil;
|
|
|
|
|
2010-06-07 17:19:09 -04:00
|
|
|
/**
|
|
|
|
* Indexed FieldURI
|
|
|
|
*/
|
|
|
|
public class IndexedFieldURI implements FieldURI {
|
2010-07-19 05:22:42 -04:00
|
|
|
protected final String fieldURI;
|
|
|
|
protected final String fieldIndex;
|
2010-06-07 17:19:09 -04:00
|
|
|
|
2010-07-10 20:13:28 -04:00
|
|
|
/**
|
|
|
|
* Create indexed field uri.
|
2010-08-18 12:56:25 -04:00
|
|
|
*
|
|
|
|
* @param fieldURI base field uri
|
|
|
|
* @param fieldIndex field name
|
2010-07-10 20:13:28 -04:00
|
|
|
*/
|
2010-06-07 17:19:09 -04:00
|
|
|
public IndexedFieldURI(String fieldURI, String fieldIndex) {
|
|
|
|
this.fieldURI = fieldURI;
|
|
|
|
this.fieldIndex = fieldIndex;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void appendTo(StringBuilder buffer) {
|
|
|
|
buffer.append("<t:IndexedFieldURI FieldURI=\"").append(fieldURI);
|
|
|
|
buffer.append("\" FieldIndex=\"").append(fieldIndex);
|
|
|
|
buffer.append("\"/>");
|
|
|
|
}
|
2010-06-29 10:15:50 -04:00
|
|
|
|
|
|
|
public void appendValue(StringBuilder buffer, String itemType, String value) {
|
2010-09-21 09:12:19 -04:00
|
|
|
buffer.append("<t:Entry Key=\"").append(fieldIndex).append("\">");
|
|
|
|
buffer.append(StringUtil.xmlEncode(value));
|
|
|
|
buffer.append("</t:Entry>");
|
2010-06-29 10:15:50 -04:00
|
|
|
}
|
2010-07-01 12:12:57 -04:00
|
|
|
|
|
|
|
public String getResponseName() {
|
|
|
|
return fieldIndex;
|
|
|
|
}
|
2010-06-07 17:19:09 -04:00
|
|
|
}
|