mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-05 10:47:59 -05:00
Do not send Exchange 2003 appointment creation request to Exchange 2007
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1561 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
3bc182ff08
commit
47e90d9bec
@ -2086,18 +2086,20 @@ public class DavExchangeSession extends ExchangeSession {
|
|||||||
String folderPath = getFolderPath("davmailtemp");
|
String folderPath = getFolderPath("davmailtemp");
|
||||||
createCalendarFolder(folderPath, null);
|
createCalendarFolder(folderPath, null);
|
||||||
|
|
||||||
PostMethod postMethod = new PostMethod(URIUtil.encodePath(folderPath));
|
|
||||||
postMethod.addParameter("Cmd", "saveappt");
|
|
||||||
postMethod.addParameter("FORMTYPE", "appointment");
|
|
||||||
String fakeEventUrl = null;
|
String fakeEventUrl = null;
|
||||||
try {
|
if ("Exchange2003".equals(serverVersion)) {
|
||||||
// create fake event
|
PostMethod postMethod = new PostMethod(URIUtil.encodePath(folderPath));
|
||||||
int statusCode = httpClient.executeMethod(postMethod);
|
postMethod.addParameter("Cmd", "saveappt");
|
||||||
if (statusCode == HttpStatus.SC_OK) {
|
postMethod.addParameter("FORMTYPE", "appointment");
|
||||||
fakeEventUrl = StringUtil.getToken(postMethod.getResponseBodyAsString(), "<span id=\"itemHREF\">", "</span>");
|
try {
|
||||||
|
// create fake event
|
||||||
|
int statusCode = httpClient.executeMethod(postMethod);
|
||||||
|
if (statusCode == HttpStatus.SC_OK) {
|
||||||
|
fakeEventUrl = StringUtil.getToken(postMethod.getResponseBodyAsString(), "<span id=\"itemHREF\">", "</span>");
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
postMethod.releaseConnection();
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
postMethod.releaseConnection();
|
|
||||||
}
|
}
|
||||||
// failover for Exchange 2007, use PROPPATCH with forced timezone
|
// failover for Exchange 2007, use PROPPATCH with forced timezone
|
||||||
if (fakeEventUrl == null) {
|
if (fakeEventUrl == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user