@Override public DownloadStream getStream() { ByteArrayInputStream in = new ByteArrayInputStream( attachment.getBody()); DownloadStream ds = new DownloadStream(in, attachment.getMIMEType(), attachment.getFileName()); // Need a file download POPUP ds.setParameter("Content-Disposition", "attachment; filename="+attachment.getFileName()); return ds; } };
/** * Create an instance of {@link Attachment } * */ public Attachment createAttachment() { return new Attachment(); }
public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { theId = (true?this.getId(): 0L); strategy.appendField(locator, this, "id", buffer, theId); theBody = this.getBody(); strategy.appendField(locator, this, "body", buffer, theBody); theCreated = this.getCreated(); strategy.appendField(locator, this, "created", buffer, theCreated); theFileName = this.getFileName(); strategy.appendField(locator, this, "fileName", buffer, theFileName); theMIMEType = this.getMIMEType(); strategy.appendField(locator, this, "mimeType", buffer, theMIMEType); theProcessInstanceId = (true?this.getProcessInstanceId(): 0L); strategy.appendField(locator, this, "processInstanceId", buffer, theProcessInstanceId); theProtectedDocument = (true?this.isProtectedDocument():false); strategy.appendField(locator, this, "protectedDocument", buffer, theProtectedDocument); theComment = this.getComment(); strategy.appendField(locator, this, "comment", buffer, theComment);
public boolean equals(Object object) { final EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE; return equals(null, null, object, strategy); }
public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
lhsId = (true?this.getId(): 0L); long rhsId; rhsId = (true?that.getId(): 0L); if (!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsId), LocatorUtils.property(thatLocator, "id", rhsId), lhsId, rhsId)) { return false; lhsBody = this.getBody(); byte[] rhsBody; rhsBody = that.getBody(); if (!strategy.equals(LocatorUtils.property(thisLocator, "body", lhsBody), LocatorUtils.property(thatLocator, "body", rhsBody), lhsBody, rhsBody)) { return false; lhsCreated = this.getCreated(); Date rhsCreated; rhsCreated = that.getCreated(); if (!strategy.equals(LocatorUtils.property(thisLocator, "created", lhsCreated), LocatorUtils.property(thatLocator, "created", rhsCreated), lhsCreated, rhsCreated)) { return false; lhsFileName = this.getFileName(); String rhsFileName; rhsFileName = that.getFileName(); if (!strategy.equals(LocatorUtils.property(thisLocator, "fileName", lhsFileName), LocatorUtils.property(thatLocator, "fileName", rhsFileName), lhsFileName, rhsFileName)) { return false; lhsMIMEType = this.getMIMEType(); String rhsMIMEType; rhsMIMEType = that.getMIMEType(); if (!strategy.equals(LocatorUtils.property(thisLocator, "mimeType", lhsMIMEType), LocatorUtils.property(thatLocator, "mimeType", rhsMIMEType), lhsMIMEType, rhsMIMEType)) { return false;
theId = (true?this.getId(): 0L); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "id", theId), currentHashCode, theId); theBody = this.getBody(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "body", theBody), currentHashCode, theBody); theCreated = this.getCreated(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "created", theCreated), currentHashCode, theCreated); theFileName = this.getFileName(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "fileName", theFileName), currentHashCode, theFileName); theMIMEType = this.getMIMEType(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "mimeType", theMIMEType), currentHashCode, theMIMEType); theProcessInstanceId = (true?this.getProcessInstanceId(): 0L); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "processInstanceId", theProcessInstanceId), currentHashCode, theProcessInstanceId); theProtectedDocument = (true?this.isProtectedDocument():false); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "protectedDocument", theProtectedDocument), currentHashCode, theProtectedDocument); theComment = this.getComment(); currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "comment", theComment), currentHashCode, theComment);