/** * Adds a file attachment to the collection. * * @param name accepts String display name of the new attachment. * @param contentStream accepts InputStream stream from which to read the content of the * attachment. * @return A FileAttachment instance. */ public FileAttachment addFileAttachment(String name, InputStream contentStream) { FileAttachment fileAttachment = new FileAttachment(this.owner); fileAttachment.setName(name); fileAttachment.setContentStream(contentStream); this.internalAdd(fileAttachment); return fileAttachment; }