/** * 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; }
/** * Adds a file attachment to the collection. * * @param name the name * @param content accepts byte byte arrays representing the content of the attachment. * @return FileAttachment */ public FileAttachment addFileAttachment(String name, byte[] content) { FileAttachment fileAttachment = new FileAttachment(this.owner); fileAttachment.setName(name); fileAttachment.setContent(content); this.internalAdd(fileAttachment); return fileAttachment; }
/** * Adds a file attachment to the collection. * * @param name accepts String display name of the new attachment. * @param fileName accepts String name of the file representing the content of the attachment. * @return A FileAttachment instance. */ public FileAttachment addFileAttachment(String name, String fileName) { FileAttachment fileAttachment = new FileAttachment(this.owner); fileAttachment.setName(name); fileAttachment.setFileName(fileName); this.internalAdd(fileAttachment); return fileAttachment; }