EWS: Fix DeleteItem for CalendarItem

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1357 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-08-17 15:42:20 +00:00
parent a4cd443485
commit 95b8bdc0d2
4 changed files with 37 additions and 3 deletions

View File

@ -28,9 +28,10 @@ public class DeleteItemMethod extends EWSMethod {
* @param itemId item id
* @param deleteType delete mode
*/
public DeleteItemMethod(ItemId itemId, DeleteType deleteType) {
public DeleteItemMethod(ItemId itemId, DeleteType deleteType, SendMeetingCancellations sendMeetingCancellations) {
super("Item", "DeleteItem");
addMethodOption(deleteType);
addMethodOption(sendMeetingCancellations);
this.itemId = itemId;
}

View File

@ -194,7 +194,7 @@ public class EwsExchangeSession extends ExchangeSession {
@Override
public void deleteMessage(ExchangeSession.Message message) throws IOException {
LOGGER.debug("Delete " + message.permanentUrl);
DeleteItemMethod deleteItemMethod = new DeleteItemMethod(((EwsExchangeSession.Message) message).itemId, DeleteType.HardDelete);
DeleteItemMethod deleteItemMethod = new DeleteItemMethod(((EwsExchangeSession.Message) message).itemId, DeleteType.HardDelete, SendMeetingCancellations.SendToNone);
executeMethod(deleteItemMethod);
}
@ -1081,7 +1081,7 @@ public class EwsExchangeSession extends ExchangeSession {
public void deleteItem(String folderPath, String itemName) throws IOException {
EWSMethod.Item item = getEwsItem(folderPath, itemName);
if (item != null) {
DeleteItemMethod deleteItemMethod = new DeleteItemMethod(new ItemId(item), DeleteType.HardDelete);
DeleteItemMethod deleteItemMethod = new DeleteItemMethod(new ItemId(item), DeleteType.HardDelete, SendMeetingCancellations.SendToNone);
executeMethod(deleteItemMethod);
}
}

View File

@ -21,6 +21,7 @@ package davmail.exchange.ews;
/**
* MessageDisposition flag.
*/
@SuppressWarnings({"JavaDoc"})
public class MessageDisposition extends AttributeOption {
private MessageDisposition(String value) {

View File

@ -0,0 +1,32 @@
/*
* 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;
/**
* Item update option.
*/
public class SendMeetingCancellations extends AttributeOption {
private SendMeetingCancellations(String value) {
super("SendMeetingCancellations", value);
}
public static final SendMeetingCancellations SendToNone = new SendMeetingCancellations("SendToNone");
public static final SendMeetingCancellations SendOnlyToAll = new SendMeetingCancellations("SendOnlyToAll");
public static final SendMeetingCancellations SendToAllAndSaveCopy = new SendMeetingCancellations("SendToAllAndSaveCopy");
}