1 16 package net.myvietnam.mvncore.web.fileupload.servlet; 17 18 import java.io.InputStream ; 19 import java.io.IOException ; 20 import javax.servlet.http.HttpServletRequest ; 21 import net.myvietnam.mvncore.web.fileupload.RequestContext; 22 23 33 public class ServletRequestContext implements RequestContext { 34 35 37 40 private HttpServletRequest request; 41 42 43 45 50 public ServletRequestContext(HttpServletRequest request) { 51 this.request = request; 52 } 53 54 55 57 62 public String getCharacterEncoding() { 63 return request.getCharacterEncoding(); 64 } 65 66 71 public String getContentType() { 72 return request.getContentType(); 73 } 74 75 80 public int getContentLength() { 81 return request.getContentLength(); 82 } 83 84 91 public InputStream getInputStream() throws IOException { 92 return request.getInputStream(); 93 } 94 95 100 public String toString() { 101 return "ContentLength=" 102 + this.getContentLength() 103 + ", ContentType=" 104 + this.getContentType(); 105 } 106 } 107 | Popular Tags |