mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-05 18:58:02 -05:00
EWS: improve failover on error retrieving MimeContent
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1897 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
4c00d1da2d
commit
443a3df55b
@ -503,9 +503,14 @@ public class EwsExchangeSession extends ExchangeSession {
|
||||
protected byte[] getContent(ItemId itemId) throws IOException {
|
||||
GetItemMethod getItemMethod = new GetItemMethod(BaseShape.ID_ONLY, itemId, true);
|
||||
executeMethod(getItemMethod);
|
||||
byte[] mimeContent = getItemMethod.getMimeContent();
|
||||
byte[] mimeContent = null;
|
||||
try {
|
||||
mimeContent = getItemMethod.getMimeContent();
|
||||
} catch (EWSException e) {
|
||||
LOGGER.warn("GetItem with MimeContent failed: "+e.getMessage());
|
||||
}
|
||||
if (mimeContent == null) {
|
||||
LOGGER.warn("GetItem returned null MimeContent, trying to rebuild from properties");
|
||||
LOGGER.warn("MimeContent not available, trying to rebuild from properties");
|
||||
try {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
getItemMethod = new GetItemMethod(BaseShape.ID_ONLY, itemId, false);
|
||||
|
Loading…
Reference in New Issue
Block a user