1 23 package org.infoglue.cms.applications.workflowtool.function.email; 24 25 import java.util.ArrayList ; 26 import java.util.List ; 27 28 import org.apache.axis.encoding.Base64; 29 import org.infoglue.deliver.util.webservices.DynamicWebserviceElement; 30 31 34 public final class RemoteAttachment extends AbstractAttachment implements DynamicWebserviceElement 35 { 36 39 public RemoteAttachment() 40 { 41 } 42 43 46 public RemoteAttachment(final String name, final String contentType, final byte[] bytes) 47 { 48 super(name, contentType, bytes); 49 } 50 51 54 public List serialize() 55 { 56 final List list = new ArrayList (); 57 list.add(getName()); 58 list.add(getContentType()); 59 list.add(Base64.encode(getBytes())); 60 return list; 61 } 62 63 66 public void deserialize(final List list) 67 { 68 if(list.size() != 3) 69 { 70 throw new IllegalArgumentException ("Illegal size"); 71 } 72 setName(list.get(0).toString()); 73 setContentType(list.get(1).toString()); 74 setBytes(Base64.decode(list.get(2).toString())); 75 } 76 } 77 | Popular Tags |