EWS: implement sendEvent

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1311 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-28 06:45:00 +00:00
parent b1c0c7c32e
commit b2496a60e6
1 changed files with 10 additions and 2 deletions

View File

@ -1062,7 +1062,15 @@ public class EwsExchangeSession extends ExchangeSession {
@Override
public int sendEvent(String icsBody) throws IOException {
throw new UnsupportedOperationException();
String itemName = UUID.randomUUID().toString() + ".EML";
byte[] mimeContent = new Event(DRAFTS, itemName, "urn:content-classes:calendarmessage", icsBody, null, null).createMimeContent();
if (mimeContent == null) {
// no recipients, cancel
return HttpStatus.SC_NO_CONTENT;
} else {
sendMessage(mimeContent);
return HttpStatus.SC_OK;
}
}
@Override
@ -1206,7 +1214,7 @@ public class EwsExchangeSession extends ExchangeSession {
}
protected static boolean isItemId(String itemName) {
return itemName.length() == 156;
return itemName.length() == 156;
}
}