我正在开发Notes 8.5.2的Lotus Notes插件,该插件将附件从电子邮件保存到硬盘。但是,当我尝试从Notes文档中读取附件名称时,我总是得到包含第一个附件名称和一些垃圾数据的相同字符串。Lotus Notes从文档
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只做一些字符串格式化以生成唯一的文件名。
听起来像我的问题,我在保存附件之前将消息转换为MIME。在转换为MIME作品之前保存附件。 感谢您的链接,值得注意的东西。 – Trellmor 2012-02-01 08:27:56