1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 19:22:22 -05:00

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
This commit is contained in:
mguessan 2011-07-20 14:43:51 +00:00
parent 0a32a5ba9e
commit 7bd0cbc5d0
3 changed files with 12 additions and 15 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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);