Browse Source

EWS: implement batch move method

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2314 3d1905a2-6b24-0410-a738-b14d5a86fcbd
master
mguessan 9 years ago
parent
commit
732ed0ec66
  1. 10
      src/java/davmail/exchange/ews/EWSMethod.java
  2. 14
      src/java/davmail/exchange/ews/MoveItemMethod.java

10
src/java/davmail/exchange/ews/EWSMethod.java

@ -54,6 +54,7 @@ public abstract class EWSMethod extends PostMethod { @@ -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 { @@ -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>");
}

14
src/java/davmail/exchange/ews/MoveItemMethod.java

@ -18,6 +18,8 @@ @@ -18,6 +18,8 @@
*/
package davmail.exchange.ews;
import java.util.List;
/**
* Move Item method.
*/
@ -33,4 +35,16 @@ public class MoveItemMethod extends EWSMethod { @@ -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;
}
}

Loading…
Cancel
Save