mirror of
https://github.com/moparisthebest/davmail
synced 2024-08-13 16:53:51 -04:00
Improve item not found logging
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1043 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
b17035afb2
commit
2f28151a64
@ -23,7 +23,6 @@ import davmail.Settings;
|
||||
import davmail.exception.DavMailAuthenticationException;
|
||||
import davmail.exception.DavMailException;
|
||||
import davmail.exception.HttpNotFoundException;
|
||||
import davmail.exception.HttpServerErrorException;
|
||||
import davmail.http.DavGatewayHttpClientFacade;
|
||||
import davmail.http.DavGatewayOTPPrompt;
|
||||
import davmail.util.StringUtil;
|
||||
@ -3091,12 +3090,14 @@ public class ExchangeSession {
|
||||
* @throws IOException on error
|
||||
*/
|
||||
public Item getItem(String folderPath, String itemName) throws IOException {
|
||||
String itemPath = folderPath + '/' + convertItemNameToEML(itemName);
|
||||
Item item;
|
||||
try {
|
||||
item = getItem(folderPath + '/' + convertItemNameToEML(itemName));
|
||||
item = getItem(itemPath);
|
||||
} catch (HttpNotFoundException hnfe) {
|
||||
// failover for Exchange 2007 plus encoding issue
|
||||
String decodedEventName = convertItemNameToEML(itemName).replaceAll("_xF8FF_", "/").replaceAll("_x003F_", "?").replaceAll("'", "''");
|
||||
LOGGER.debug("Item not found at "+itemPath+", search by displayname: '"+decodedEventName+ '\'');
|
||||
ExchangeSession.MessageList messages = searchMessages(folderPath, " AND \"DAV:displayname\"='" + decodedEventName + '\'');
|
||||
if (!messages.isEmpty()) {
|
||||
item = getItem(messages.get(0).getPermanentUrl());
|
||||
|
Loading…
Reference in New Issue
Block a user