Xpages 嵌入式对象 - 如何检索附件的文件日期

Xpages Embedded Object - How to retrieve File Date of an Attachment

我已经能够遍历附件并检索文件名,但我还想检索文件日期,但似乎找不到任何说明如何完成此操作的文档。

    if (attachDoc.hasItem("Attachments")){
        var attachment:NotesRichTextItem = attachDoc.getFirstItem("Attachments");
        
        if (attachment != null) {
            var eos:java.util.Vector = attachment.getEmbeddedObjects();
            if (eos.isEmpty()) {
                print("Attachments empty: no files do nothing");
            } else {
                //print("added attached");
                var e:Enumeration = eos.elements(); 
                while (e.hasMoreElements()) {
                    var eoA:EmbeddedObject = e.nextElement();
                    if(eoA.getFileSize() < 10000000){
                        print(eoA.getName());//this shows file names correctly
                        print(eoA.getFileDate());//this fails. Error calling method...
                    }else{
                        print("Unable to send the email. The file size is " + Math.round(eoA.getFileSize()/1000000) + "MB.");
                    }
                }
            }
        }
        attachment.recycle();
    }
    attachDoc.recycle();
}catch(e){
    print("error with attachment " + e.toString());
}

能得到你的帮助我将不胜感激。

您可以使用

eoA.getFileCreated()

eoA.getFileModified()

两者都是 return 表示文件 created/last 修改日期和时间的字符串。