mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
reimplement index based attachment retrieval
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@46 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
8051c57537
commit
3582bac793
@ -822,6 +822,13 @@ public class ExchangeSession {
|
||||
if (attachment == null && partHeader.name == null) {
|
||||
attachment = attachmentsMap.get(String.valueOf(attachmentIndex));
|
||||
}
|
||||
// try to get by index if attachment renamed to application
|
||||
if (attachment == null && partHeader.name != null) {
|
||||
Attachment currentAttachment = attachmentsMap.get(String.valueOf(attachmentIndex));
|
||||
if (currentAttachment.name.startsWith("application")) {
|
||||
attachment = currentAttachment;
|
||||
}
|
||||
}
|
||||
attachmentIndex++;
|
||||
if (attachment == null) {
|
||||
// only warn, could happen depending on IIS config
|
||||
@ -1101,7 +1108,7 @@ public class ExchangeSession {
|
||||
getMethod.releaseConnection();
|
||||
|
||||
attachmentsMap = new HashMap<String, Attachment>();
|
||||
int attachmentIndex = 2;
|
||||
int attachmentIndex = 1;
|
||||
// list file attachments identified explicitly
|
||||
List<Attribute> list = xmlDocument.getNodes("//table[@id='idAttachmentWell']//a/@href");
|
||||
for (Attribute element : list) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user