Carddav: disable contact picture handling on Exchange 2007

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1314 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-28 21:10:58 +00:00
parent 5ea415bf49
commit 04bf3294bc
1 changed files with 20 additions and 17 deletions

View File

@ -776,6 +776,8 @@ public class EwsExchangeSession extends ExchangeSession {
ItemId newItemId = new ItemId(createOrUpdateItemMethod.getResponseItem());
// disable contact picture handling on Exchange 2007
if (!"Exchange2010".equals(serverVersion)) {
// first delete current picture
if (currentFileAttachment != null) {
DeleteAttachmentMethod deleteAttachmentMethod = new DeleteAttachmentMethod(currentFileAttachment.attachmentId);
@ -794,6 +796,7 @@ public class EwsExchangeSession extends ExchangeSession {
CreateAttachmentMethod createAttachmentMethod = new CreateAttachmentMethod(newItemId, attachment);
executeMethod(createAttachmentMethod);
}
}
GetItemMethod getItemMethod = new GetItemMethod(BaseShape.ID_ONLY, newItemId, false);
getItemMethod.addAdditionalProperty(Field.get("etag"));