EWS: improve main calendar folder test

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@2326 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2015-01-24 21:16:28 +00:00
parent 611136e3a0
commit dba3ff26ef
2 changed files with 6 additions and 4 deletions

View File

@ -3304,7 +3304,7 @@ public abstract class ExchangeSession {
* @param folderPath absolute folder path * @param folderPath absolute folder path
* @return true if folderPath is a public or shared folder * @return true if folderPath is a public or shared folder
*/ */
public abstract boolean isMainCalendar(String folderPath); public abstract boolean isMainCalendar(String folderPath) throws IOException;
static final String MAILBOX_BASE = "/cn="; static final String MAILBOX_BASE = "/cn=";

View File

@ -1715,7 +1715,7 @@ public class EwsExchangeSession extends ExchangeSession {
createOrUpdateItemMethod.setTimezoneContext(EwsExchangeSession.this.getVTimezone().getPropertyValue("TZID")); createOrUpdateItemMethod.setTimezoneContext(EwsExchangeSession.this.getVTimezone().getPropertyValue("TZID"));
} }
//} //}
} }
executeMethod(createOrUpdateItemMethod); executeMethod(createOrUpdateItemMethod);
itemResult.status = createOrUpdateItemMethod.getStatusCode(); itemResult.status = createOrUpdateItemMethod.getStatusCode();
@ -2160,8 +2160,10 @@ public class EwsExchangeSession extends ExchangeSession {
} }
@Override @Override
public boolean isMainCalendar(String folderPath) { public boolean isMainCalendar(String folderPath) throws IOException {
return "calendar".equalsIgnoreCase(folderPath) || (currentMailboxPath + "/calendar").equalsIgnoreCase(folderPath); FolderId currentFolderId = getFolderId(folderPath);
FolderId calendarFolderId = getFolderId("calendar");
return calendarFolderId.name.equals(currentFolderId.name) && calendarFolderId.value.equals(currentFolderId.value);
} }
@Override @Override