From 732ed0ec6637f2266a6729d24ebc2246a22b55b8 Mon Sep 17 00:00:00 2001 From: mguessan Date: Thu, 4 Sep 2014 06:43:45 +0000 Subject: [PATCH] EWS: implement batch move method git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2314 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ews/EWSMethod.java | 10 +++++++++- src/java/davmail/exchange/ews/MoveItemMethod.java | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/java/davmail/exchange/ews/EWSMethod.java b/src/java/davmail/exchange/ews/EWSMethod.java index 31820957..5fc77916 100644 --- a/src/java/davmail/exchange/ews/EWSMethod.java +++ b/src/java/davmail/exchange/ews/EWSMethod.java @@ -54,6 +54,7 @@ public abstract class EWSMethod extends PostMethod { protected FolderId toFolderId; protected FolderId parentFolderId; protected ItemId itemId; + protected List itemIds; protected ItemId parentItemId; protected Set additionalProperties; protected Disposal deleteType; @@ -197,7 +198,14 @@ public abstract class EWSMethod extends PostMethod { if (updates == null) { writer.write(""); } - itemId.write(writer); + if (itemId != null) { + itemId.write(writer); + } + if (itemIds != null) { + for (ItemId localItemId:itemIds) { + localItemId.write(writer); + } + } if (updates == null) { writer.write(""); } diff --git a/src/java/davmail/exchange/ews/MoveItemMethod.java b/src/java/davmail/exchange/ews/MoveItemMethod.java index e22d1350..e5d7dd03 100644 --- a/src/java/davmail/exchange/ews/MoveItemMethod.java +++ b/src/java/davmail/exchange/ews/MoveItemMethod.java @@ -18,6 +18,8 @@ */ package davmail.exchange.ews; +import java.util.List; + /** * Move Item method. */ @@ -33,4 +35,16 @@ public class MoveItemMethod extends EWSMethod { this.itemId = itemId; this.toFolderId = toFolderId; } + + /** + * Move items to target folder. + * + * @param itemIds item id list + * @param toFolderId target folder id + */ + public MoveItemMethod(List itemIds, FolderId toFolderId) { + super("Item", "MoveItem"); + this.itemIds = itemIds; + this.toFolderId = toFolderId; + } }