How do I get all the attachments from a .nsf(lotus notes) file using java

后端 未结 4 697
耶瑟儿~
耶瑟儿~ 2021-01-01 05:50

Steps followed :

Took a back of my lotus notes as sample.nsf

And then tried to read the attachments from the sample.nsf

Cod

4条回答
  •  失恋的感觉
    2021-01-01 06:06

    Easy way to get all the attachments from Lotus Notes using Java.

    Document doc = dc.getFirstDocument();
    for(var att :session.evaluate("@AttachmentNames", doc)){
        if (att == null || att.toString().isEmpty()) {
              continue;
       }
       EmbeddedObject eb = doc.getAttachment(att.toString());
       System.out.println(eb.getName());
       System.out.println(eb.getFileSize());
       eb.extractFile("a.txt");// give file name what u  want
    }
    

提交回复
热议问题