1 16 package net.jforum.util.legacy.commons.fileupload.servlet; 17 18 import java.io.IOException ; 19 import java.io.InputStream ; 20 21 import javax.servlet.http.HttpServletRequest ; 22 23 import net.jforum.util.legacy.commons.fileupload.RequestContext; 24 25 35 public class ServletRequestContext implements RequestContext { 36 37 39 42 private HttpServletRequest request; 43 44 45 47 52 public ServletRequestContext(HttpServletRequest request) { 53 this.request = request; 54 } 55 56 57 59 64 public String getContentType() { 65 return request.getContentType(); 66 } 67 68 73 public int getContentLength() { 74 return request.getContentLength(); 75 } 76 77 84 public InputStream getInputStream() throws IOException { 85 return request.getInputStream(); 86 } 87 88 public String toString() { 89 return "ContentLength=" 90 + this.getContentLength() 91 + ", ContentType=" 92 + this.getContentType(); 93 } 94 } 95 | Popular Tags |