I am able to attach a file to RichTextItem
of a domino document that I receive as an InputStream
. Below is the code snippet:
attachDocument(InputStream is){
.....
File attFile = saveInputStr(is);
Document attdoc = testdb.createDocument();
attDoc.replaceItemValue("Form", "formAttachment");
RichTextItem rti = (RichTextItem) attDoc.getFirstItem("attachment");
rti.embedObject(EmbeddedObject.EMBED_ATTACHMENT, "", attFile .getPath(), attFile .getName());
.....
}
This works fine. But what if I don't want to write the file to disk, like I save it to a File
i.e. attFile
in the above snippet. Is there a way that to write the contents of InputStream
to a file (may be using some notes document) and attach it with out saving to disk.