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

Fix bug on ITEM_PROPERTIES value on EWS/WebDav mode switch

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1824 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-10-19 20:49:46 +00:00
parent 08bcbfc4a9
commit 7640fcd8ec
3 changed files with 36 additions and 15 deletions

View File

@ -2468,19 +2468,7 @@ public abstract class ExchangeSession {
}
/**
* Common item properties
*/
protected static final Set<String> ITEM_PROPERTIES = new HashSet<String>();
static {
ITEM_PROPERTIES.add("etag");
ITEM_PROPERTIES.add("displayname");
// calendar CdoInstanceType
ITEM_PROPERTIES.add("instancetype");
ITEM_PROPERTIES.add("urlcompname");
ITEM_PROPERTIES.add("subject");
}
protected abstract Set<String> getItemProperties();
/**
* Search contacts in provided folder.
@ -2490,7 +2478,7 @@ public abstract class ExchangeSession {
* @throws IOException on error
*/
public List<ExchangeSession.Contact> getAllContacts(String folderPath) throws IOException {
return searchContacts(folderPath, ITEM_PROPERTIES, isEqualTo("outlookmessageclass", "IPM.Contact"), 0);
return searchContacts(folderPath, getItemProperties(), isEqualTo("outlookmessageclass", "IPM.Contact"), 0);
}
@ -2621,7 +2609,7 @@ public abstract class ExchangeSession {
privateCondition = isEqualTo("sensitivity", 0);
}
return searchEvents(folderPath, ITEM_PROPERTIES,
return searchEvents(folderPath, getItemProperties(),
and(filter, privateCondition));
}

View File

@ -2043,6 +2043,24 @@ public class DavExchangeSession extends ExchangeSession {
return contacts;
}
/**
* Common item properties
*/
protected static final Set<String> ITEM_PROPERTIES = new HashSet<String>();
static {
ITEM_PROPERTIES.add("etag");
ITEM_PROPERTIES.add("displayname");
// calendar CdoInstanceType
ITEM_PROPERTIES.add("instancetype");
ITEM_PROPERTIES.add("urlcompname");
ITEM_PROPERTIES.add("subject");
}
protected Set<String> getItemProperties() {
return ITEM_PROPERTIES;
}
/**
* @inheritDoc
*/

View File

@ -1615,7 +1615,18 @@ public class EwsExchangeSession extends ExchangeSession {
return events;
}
/**
* Common item properties
*/
protected static final Set<String> ITEM_PROPERTIES = new HashSet<String>();
static {
ITEM_PROPERTIES.add("etag");
ITEM_PROPERTIES.add("displayname");
// calendar CdoInstanceType
ITEM_PROPERTIES.add("instancetype");
ITEM_PROPERTIES.add("urlcompname");
ITEM_PROPERTIES.add("subject");
ITEM_PROPERTIES.add("calendaritemtype");
ITEM_PROPERTIES.add("isrecurring");
}
@ -1630,6 +1641,10 @@ public class EwsExchangeSession extends ExchangeSession {
EVENT_REQUEST_PROPERTIES.add("urlcompname");
}
protected Set<String> getItemProperties() {
return ITEM_PROPERTIES;
}
protected EWSMethod.Item getEwsItem(String folderPath, String itemName) throws IOException {
EWSMethod.Item item = null;
String urlcompname = convertItemNameToEML(itemName);