1 3 package jodd.servlet.upload; 4 5 import java.io.*; 6 7 14 public abstract class FileUpload { 15 16 protected MultipartRequestInputStream input; 17 protected FileUploadHeader header; 18 19 public FileUpload(MultipartRequestInputStream input) { 20 this.input = input; 21 this.header = input.lastHeader; 22 } 23 24 26 public FileUploadHeader getHeader() { 27 return header; 28 } 29 31 protected boolean uploaded = true; 32 protected int size = -1; 33 34 37 public int getSize() { 38 return size; 39 } 40 41 44 public boolean isUploaded() { 45 return uploaded; 46 } 47 48 50 57 protected abstract void processStream() throws IOException; 58 59 61 64 public String toString() { 65 return "FileUpload: uploaded=[" + uploaded + "] field=[" + header.getFormFieldName() + 66 "] name=[" + header.getFileName() + "] size=[" + size + ']'; 67 } 68 } | Popular Tags |