Commit 42e12383 authored by Mickaël Guessant's avatar Mickaël Guessant

EWS: implement batch move method

git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@2314 3d1905a2-6b24-0410-a738-b14d5a86fcbd
parent 55bfe1a5
......@@ -54,6 +54,7 @@ public abstract class EWSMethod extends PostMethod {
protected FolderId toFolderId;
protected FolderId parentFolderId;
protected ItemId itemId;
protected List<ItemId> itemIds;
protected ItemId parentItemId;
protected Set<FieldURI> additionalProperties;
protected Disposal deleteType;
......@@ -197,7 +198,14 @@ public abstract class EWSMethod extends PostMethod {
if (updates == null) {
writer.write("<m:ItemIds>");
}
itemId.write(writer);
if (itemId != null) {
itemId.write(writer);
}
if (itemIds != null) {
for (ItemId localItemId:itemIds) {
localItemId.write(writer);
}
}
if (updates == null) {
writer.write("</m:ItemIds>");
}
......
......@@ -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<ItemId> itemIds, FolderId toFolderId) {
super("Item", "MoveItem");
this.itemIds = itemIds;
this.toFolderId = toFolderId;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment