1 23 package org.infoglue.cms.applications.workflowtool.function.email; 24 25 public abstract class AbstractAttachment implements Attachment 26 { 27 30 private byte[] bytes; 31 32 35 private String name; 36 37 40 private String contentType; 41 42 45 protected AbstractAttachment() 46 { 47 } 48 49 52 protected AbstractAttachment(final String name, final String contentType, final byte[] bytes) 53 { 54 super(); 55 this.name = name; 56 this.contentType = contentType; 57 this.bytes = bytes; 58 } 59 60 63 public byte[] getBytes() 64 { 65 return bytes; 66 } 67 68 71 public void setBytes(final byte[] bytes) 72 { 73 this.bytes = bytes; 74 } 75 76 79 public String getName() 80 { 81 return name; 82 } 83 84 87 public void setName(final String name) 88 { 89 this.name = name; 90 } 91 92 95 public int getSize() 96 { 97 return getBytes().length; 98 } 99 100 103 public String getContentType() 104 { 105 return contentType; 106 } 107 108 111 public void setContentType(final String contentType) 112 { 113 this.contentType = contentType; 114 } 115 116 119 public String toString() 120 { 121 return "<" + getSize() + "," + getName() + "," + getContentType() + ">"; 122 } 123 } 124 | Popular Tags |