【发布时间】:2012-01-31 16:28:49
【问题描述】:
我正在为 Notes 8.5.2 开发一个 Lotus Notes 插件,它将附件从电子邮件保存到硬盘。但是当我尝试从 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 只进行一些字符串格式化以生成唯一的文件名。
【问题讨论】:
标签: java lotus-notes lotus