I'm developing an Lotus Notes plug-in for Notes 8.5.2 that saves the attachments from an eMail to the Harddisk. But when I try to read the attachment names from a Notes document I always get the same string containing the first attachment name + some junk data.
protected Vector<String> getAttachmentNames() throws NotesException,
IOException {
Vector<String> attachmentNames = new Vector<String>();
Item item = null;
Enumeration<?> itemsEnum = mailDoc.getItems().elements();
while (itemsEnum.hasMoreElements()) {
item = (Item) itemsEnum.nextElement();
if (item.getType() == Item.ATTACHMENT) {
attachmentNames.add(getAttachmentNameOf(item));
}
}
return attachmentNames;
}
protected String getAttachmentNameOf(Item item) throws NotesException,
IOException {
return getAttachmentName(item.getValueString());
}
getAttachmentName only does some string formatting to generate a unique filename.