1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-14 03:32:22 -05:00

EWS: Exchange 2010 folder handling

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1297 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-27 10:39:53 +00:00
parent 8947927c01
commit 37d795d027
2 changed files with 7 additions and 2 deletions

View File

@ -490,6 +490,7 @@ public class EwsExchangeSession extends ExchangeSession {
static {
FOLDER_PROPERTIES.add(Field.get("urlcompname"));
FOLDER_PROPERTIES.add(Field.get("folderDisplayName"));
FOLDER_PROPERTIES.add(Field.get("lastmodified"));
FOLDER_PROPERTIES.add(Field.get("folderclass"));
FOLDER_PROPERTIES.add(Field.get("ctag"));
@ -502,7 +503,7 @@ public class EwsExchangeSession extends ExchangeSession {
protected Folder buildFolder(EWSMethod.Item item) {
Folder folder = new Folder();
folder.folderId = new FolderId(item);
folder.displayName = StringUtil.urlDecodeAmpersand(item.get(Field.get("urlcompname").getResponseName()));
folder.displayName = item.get(Field.get("folderDisplayName").getResponseName());
folder.folderClass = item.get(Field.get("folderclass").getResponseName());
folder.etag = item.get(Field.get("lastmodified").getResponseName());
folder.ctag = item.get(Field.get("ctag").getResponseName());
@ -1118,7 +1119,7 @@ public class EwsExchangeSession extends ExchangeSession {
parentFolderId,
FOLDER_PROPERTIES,
new TwoOperandExpression(TwoOperandExpression.Operator.IsEqualTo,
Field.get("urlcompname"), folderName)
Field.get("folderDisplayName"), folderName)
);
executeMethod(findFolderMethod);
EWSMethod.Item item = findFolderMethod.getResponseItem();

View File

@ -69,6 +69,7 @@ public class TestExchangeSessionFolder extends AbstractExchangeSessionTestCase {
public void testCalendarFolder() throws IOException {
String folderName = "testcalendar";
session.deleteFolder(folderName);
session.createCalendarFolder(folderName, null);
ExchangeSession.Folder folder = session.getFolder(folderName);
assertNotNull(folder);
@ -78,6 +79,7 @@ public class TestExchangeSessionFolder extends AbstractExchangeSessionTestCase {
public void testContactFolder() throws IOException {
String folderName = "testcontact";
session.deleteFolder(folderName);
session.createContactFolder(folderName, null);
ExchangeSession.Folder folder = session.getFolder(folderName);
assertNotNull(folder);
@ -88,6 +90,7 @@ public class TestExchangeSessionFolder extends AbstractExchangeSessionTestCase {
public void testFolderAccent() throws IOException {
String folderName = "testé";
session.deleteFolder(folderName);
session.createMessageFolder(folderName);
ExchangeSession.Folder folder = session.getFolder(folderName);
assertNotNull(folder);
@ -98,6 +101,7 @@ public class TestExchangeSessionFolder extends AbstractExchangeSessionTestCase {
public void testFolderSpace() throws IOException {
String folderName = "test space";
session.deleteFolder(folderName);
session.createMessageFolder(folderName);
ExchangeSession.Folder folder = session.getFolder(folderName);
assertNotNull(folder);