From 67e4c1b3b8516e4be0b5ef9b32f566ef2e138004 Mon Sep 17 00:00:00 2001 From: mguessan Date: Tue, 13 Nov 2007 22:26:02 +0000 Subject: [PATCH] add zip and PDF to recognized extensions in attachment content type fix git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@106 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/ExchangeSession.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/java/davmail/exchange/ExchangeSession.java b/src/java/davmail/exchange/ExchangeSession.java index 9e42edc8..b7a83111 100644 --- a/src/java/davmail/exchange/ExchangeSession.java +++ b/src/java/davmail/exchange/ExchangeSession.java @@ -1164,8 +1164,12 @@ public class ExchangeSession { throw new RuntimeException("Exception retrieving " + attachmentUrl + " : " + e + " " + e.getCause()); } // fix content type for known extension - if ("application/octet-stream".equalsIgnoreCase(result) && attachmentUrl.endsWith(".pdf")) { - result = "application/pdf"; + if ("application/octet-stream".equalsIgnoreCase(result)) { + if (attachmentUrl.endsWith(".pdf") || attachmentUrl.endsWith(".PDF")) { + result = "application/pdf"; + } else if (attachmentUrl.endsWith(".zip") || attachmentUrl.endsWith(".ZIP")) { + result = "application/zip"; + } } return result;