1 17 18 package org.objectweb.jac.aspects.gui.web; 19 20 import java.io.IOException ; 21 import java.io.InputStreamReader ; 22 import java.io.PrintWriter ; 23 import org.objectweb.jac.core.rtti.FieldItem; 24 import org.objectweb.jac.lib.Attachment; 25 import org.objectweb.jac.util.Streams; 26 27 public class InputStreamEditor extends AbstractFieldEditor 28 implements HTMLEditor 29 { 30 public InputStreamEditor(Object substance, FieldItem field) { 31 super(substance,field); 32 } 33 34 36 protected boolean doReadValue(Object parameter) { 37 RequestPart part = (RequestPart)parameter; 38 if (part.getFilename()==null || part.getFilename().equals("")) { 39 return false; 40 } 41 setValue(part.getData()); 42 return true; 43 } 44 45 public void genHTML(PrintWriter out) { 46 out.print("<input name=\""+label+"\" type=\"file\">"); 47 } 48 } 49 | Popular Tags |