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
* @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=";

View File

@ -2160,8 +2160,10 @@ public class EwsExchangeSession extends ExchangeSession {
}
@Override
public boolean isMainCalendar(String folderPath) {
return "calendar".equalsIgnoreCase(folderPath) || (currentMailboxPath + "/calendar").equalsIgnoreCase(folderPath);
public boolean isMainCalendar(String folderPath) throws IOException {
FolderId currentFolderId = getFolderId(folderPath);
FolderId calendarFolderId = getFolderId("calendar");
return calendarFolderId.name.equals(currentFolderId.name) && calendarFolderId.value.equals(currentFolderId.value);
}
@Override