IMAP: fix absolute (public) path handling

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@720 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-09-15 09:48:52 +00:00
parent 3908884444
commit 4d46d7c078
1 changed files with 8 additions and 1 deletions

View File

@ -832,7 +832,12 @@ public class ExchangeSession {
folder.folderPath = href.substring(index + mailPath.length());
}
} else {
throw new DavMailException("EXCEPTION_INVALID_FOLDER_URL", folder.folderPath);
try {
URI folderURI = new URI(href, false);
folder.folderPath = folderURI.getPath();
} catch (URIException e) {
throw new DavMailException("EXCEPTION_INVALID_FOLDER_URL", href);
}
}
}
return folder;
@ -970,6 +975,8 @@ public class ExchangeSession {
folderPath = folderName.replaceFirst("Sent", sentitemsUrl);
} else if (folderName.startsWith("calendar")) {
folderPath = folderName.replaceFirst("calendar", calendarUrl);
} else if (folderName.startsWith("public")) {
folderPath = '/' + folderName;
// absolute folder path
} else if (folderName.startsWith("/")) {
folderPath = folderName;