1 19 20 21 29 30 package za.org.coefficient.util.common; 32 33 34 40 43 public class UploadedFile implements java.io.Serializable { 44 46 private String contentType; 47 private String filename; 48 private byte[] content; 49 50 52 56 public UploadedFile(String contentType, byte[] content, String filepath) { 57 this.contentType = contentType; 58 this.content = content; 59 60 int backSlashPos = filepath.lastIndexOf('\\'); 62 int fowardSlashPos = filepath.lastIndexOf('/'); 63 filename = 64 filepath.substring(Math.max(backSlashPos, fowardSlashPos) + 1); 65 } 66 67 69 public byte[] getContent() { 70 return content; 71 } 72 73 public String getContentType() { 74 return contentType; 75 } 76 77 public String getFilename() { 78 return filename; 79 } 80 } 81 | Popular Tags |