From 7bd0cbc5d0aeb76c163b1ce2c39b94376c8085b9 Mon Sep 17 00:00:00 2001 From: mguessan Date: Wed, 20 Jul 2011 14:43:51 +0000 Subject: [PATCH] Caldav: implement merged folder ctag over WebDav git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1743 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 11 ++++++++++- .../davmail/exchange/dav/DavExchangeSession.java | 2 +- .../davmail/exchange/ews/EwsExchangeSession.java | 14 +------------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index 8033daa7..d0e7993e 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -1247,7 +1247,16 @@ public abstract class ExchangeSession { * @return Folder object * @throws IOException on error */ - public abstract Folder getFolder(String folderName) throws IOException; + public ExchangeSession.Folder getFolder(String folderPath) throws IOException { + Folder folder = internalGetFolder(folderPath); + if (isMainCalendar(folderPath)) { + Folder taskFolder = internalGetFolder(TASKS); + folder.ctag += taskFolder.ctag; + } + return folder; + } + + protected abstract Folder internalGetFolder(String folderName) throws IOException; /** * Check folder ctag and reload messages as needed. diff --git a/src/java/davmail/exchange/dav/DavExchangeSession.java b/src/java/davmail/exchange/dav/DavExchangeSession.java index 03a76d0b..a2e688cd 100644 --- a/src/java/davmail/exchange/dav/DavExchangeSession.java +++ b/src/java/davmail/exchange/dav/DavExchangeSession.java @@ -1695,7 +1695,7 @@ public class DavExchangeSession extends ExchangeSession { * @inheritDoc */ @Override - public Folder getFolder(String folderPath) throws IOException { + protected Folder internalGetFolder(String folderPath) throws IOException { MultiStatusResponse[] responses = DavGatewayHttpClientFacade.executePropFindMethod( httpClient, URIUtil.encodePath(getFolderPath(folderPath)), 0, FOLDER_PROPERTIES_NAME_SET); Folder folder = null; diff --git a/src/java/davmail/exchange/ews/EwsExchangeSession.java b/src/java/davmail/exchange/ews/EwsExchangeSession.java index a8dab47c..3948c64e 100644 --- a/src/java/davmail/exchange/ews/EwsExchangeSession.java +++ b/src/java/davmail/exchange/ews/EwsExchangeSession.java @@ -877,19 +877,6 @@ public class EwsExchangeSession extends ExchangeSession { } } - /** - * @inheritDoc - */ - @Override - public ExchangeSession.Folder getFolder(String folderPath) throws IOException { - Folder folder = internalGetFolder(folderPath); - if (isMainCalendar(folderPath)) { - Folder taskFolder = internalGetFolder(TASKS); - folder.ctag += taskFolder.ctag; - } - return folder; - } - /** * Get folder by path. * @@ -897,6 +884,7 @@ public class EwsExchangeSession extends ExchangeSession { * @return folder object * @throws IOException on error */ + @Override protected EwsExchangeSession.Folder internalGetFolder(String folderPath) throws IOException { FolderId folderId = getFolderId(folderPath); GetFolderMethod getFolderMethod = new GetFolderMethod(BaseShape.ID_ONLY, folderId, FOLDER_PROPERTIES);