Currently we are attaching a file to a Lotus Document with the following code:
final RichTextItem rtitem = document.createRichTextItem(referenceName);
final int type = EmbeddedObject.EMBED_ATTACHMENT;
final String clazz = null;
final String source = file.getFileName();
rtitem.embedObject(type, clazz, source, name);
document.save();
Unfortunately the source
parameter of the embedObject
method has to be a path of a file in the file system. Is it possible to embed an object from a stream somehow? The embeddable content currently is in the memory, so it's not too efficient (and clean) to write it out to a file and let the Lotus API to read it again.