1 17 18 19 package org.apache.catalina.core; 20 21 22 import java.io.BufferedReader ; 23 import java.io.IOException ; 24 import java.io.InputStream ; 25 import java.io.UnsupportedEncodingException ; 26 import java.net.Socket ; 27 import java.security.Principal ; 28 import java.util.Enumeration ; 29 import java.util.Iterator ; 30 import java.util.Locale ; 31 import java.util.Map ; 32 33 import javax.servlet.FilterChain ; 34 import javax.servlet.RequestDispatcher ; 35 import javax.servlet.ServletInputStream ; 36 import javax.servlet.ServletRequest ; 37 import javax.servlet.http.Cookie ; 38 import javax.servlet.http.HttpServletRequest ; 39 import javax.servlet.http.HttpSession ; 40 41 import org.apache.catalina.Context; 42 import org.apache.catalina.Host; 43 import org.apache.catalina.Wrapper; 44 import org.apache.catalina.connector.Connector; 45 import org.apache.catalina.connector.Response; 46 import org.apache.tomcat.util.buf.MessageBytes; 47 48 49 56 57 public class DummyRequest 58 implements HttpServletRequest { 59 60 public DummyRequest() { 61 } 62 63 public DummyRequest(String contextPath, String decodedURI, 64 String queryString) { 65 this.contextPath = contextPath; 66 this.decodedURI = decodedURI; 67 this.queryString = queryString; 68 } 69 70 protected String contextPath = null; 71 protected String decodedURI = null; 72 protected String queryString = null; 73 74 protected String pathInfo = null; 75 protected String servletPath = null; 76 protected Wrapper wrapper = null; 77 78 protected FilterChain filterChain = null; 79 80 private static Enumeration dummyEnum = new Enumeration (){ 81 public boolean hasMoreElements(){ 82 return false; 83 } 84 public Object nextElement(){ 85 return null; 86 } 87 }; 88 89 public String getContextPath() { 90 return (contextPath); 91 } 92 93 public MessageBytes getContextPathMB() { 94 return null; 95 } 96 97 public ServletRequest getRequest() { 98 return (this); 99 } 100 101 public String getDecodedRequestURI() { 102 return decodedURI; 103 } 104 105 public MessageBytes getDecodedRequestURIMB() { 106 return null; 107 } 108 109 public FilterChain getFilterChain() { 110 return (this.filterChain); 111 } 112 113 public void setFilterChain(FilterChain filterChain) { 114 this.filterChain = filterChain; 115 } 116 117 public String getQueryString() { 118 return queryString; 119 } 120 121 public void setQueryString(String query) { 122 queryString = query; 123 } 124 125 public String getPathInfo() { 126 return pathInfo; 127 } 128 129 public void setPathInfo(String path) { 130 pathInfo = path; 131 } 132 133 public MessageBytes getPathInfoMB() { 134 return null; 135 } 136 137 public MessageBytes getRequestPathMB() { 138 return null; 139 } 140 141 public String getServletPath() { 142 return servletPath; 143 } 144 145 public void setServletPath(String path) { 146 servletPath = path; 147 } 148 149 public MessageBytes getServletPathMB() { 150 return null; 151 } 152 153 public Wrapper getWrapper() { 154 return (this.wrapper); 155 } 156 157 public void setWrapper(Wrapper wrapper) { 158 this.wrapper = wrapper; 159 } 160 161 public String getAuthorization() { return null; } 162 public void setAuthorization(String authorization) {} 163 public Connector getConnector() { return null; } 164 public void setConnector(Connector connector) {} 165 public Context getContext() { return null; } 166 public void setContext(Context context) {} 167 public Host getHost() { return null; } 168 public void setHost(Host host) {} 169 public String getInfo() { return null; } 170 public Response getResponse() { return null; } 171 public void setResponse(Response response) {} 172 public Socket getSocket() { return null; } 173 public void setSocket(Socket socket) {} 174 public InputStream getStream() { return null; } 175 public void setStream(InputStream input) {} 176 public void addLocale(Locale locale) {} 177 public ServletInputStream createInputStream() throws IOException { 178 return null; 179 } 180 public void finishRequest() throws IOException {} 181 public Object getNote(String name) { return null; } 182 public Iterator getNoteNames() { return null; } 183 public void removeNote(String name) {} 184 public void setContentType(String type) {} 185 public void setNote(String name, Object value) {} 186 public void setProtocol(String protocol) {} 187 public void setRemoteAddr(String remoteAddr) {} 188 public void setRemoteHost(String remoteHost) {} 189 public void setScheme(String scheme) {} 190 public void setServerName(String name) {} 191 public void setServerPort(int port) {} 192 public Object getAttribute(String name) { return null; } 193 public Enumeration getAttributeNames() { return null; } 194 public String getCharacterEncoding() { return null; } 195 public int getContentLength() { return -1; } 196 public void setContentLength(int length) {} 197 public String getContentType() { return null; } 198 public ServletInputStream getInputStream() throws IOException { 199 return null; 200 } 201 public Locale getLocale() { return null; } 202 public Enumeration getLocales() { return null; } 203 public String getProtocol() { return null; } 204 public BufferedReader getReader() throws IOException { return null; } 205 public String getRealPath(String path) { return null; } 206 public String getRemoteAddr() { return null; } 207 public String getRemoteHost() { return null; } 208 public String getScheme() { return null; } 209 public String getServerName() { return null; } 210 public int getServerPort() { return -1; } 211 public boolean isSecure() { return false; } 212 public void removeAttribute(String name) {} 213 public void setAttribute(String name, Object value) {} 214 public void setCharacterEncoding(String enc) 215 throws UnsupportedEncodingException {} 216 public void addCookie(Cookie cookie) {} 217 public void addHeader(String name, String value) {} 218 public void addParameter(String name, String values[]) {} 219 public void clearCookies() {} 220 public void clearHeaders() {} 221 public void clearLocales() {} 222 public void clearParameters() {} 223 public void recycle() {} 224 public void setAuthType(String authType) {} 225 public void setContextPath(String path) {} 226 public void setMethod(String method) {} 227 public void setRequestedSessionCookie(boolean flag) {} 228 public void setRequestedSessionId(String id) {} 229 public void setRequestedSessionURL(boolean flag) {} 230 public void setRequestURI(String uri) {} 231 public void setSecure(boolean secure) {} 232 public void setUserPrincipal(Principal principal) {} 233 public String getParameter(String name) { return null; } 234 public Map getParameterMap() { return null; } 235 public Enumeration getParameterNames() { return dummyEnum; } 236 public String [] getParameterValues(String name) { return null; } 237 public RequestDispatcher getRequestDispatcher(String path) { 238 return null; 239 } 240 public String getAuthType() { return null; } 241 public Cookie [] getCookies() { return null; } 242 public long getDateHeader(String name) { return -1; } 243 public String getHeader(String name) { return null; } 244 public Enumeration getHeaders(String name) { return null; } 245 public Enumeration getHeaderNames() { return null; } 246 public int getIntHeader(String name) { return -1; } 247 public String getMethod() { return null; } 248 public String getPathTranslated() { return null; } 249 public String getRemoteUser() { return null; } 250 public String getRequestedSessionId() { return null; } 251 public String getRequestURI() { return null; } 252 public void setDecodedRequestURI(String uri) {} 253 public StringBuffer getRequestURL() { return null; } 254 public HttpSession getSession() { return null; } 255 public HttpSession getSession(boolean create) { return null; } 256 public boolean isRequestedSessionIdFromCookie() { return false; } 257 public boolean isRequestedSessionIdFromURL() { return false; } 258 public boolean isRequestedSessionIdFromUrl() { return false; } 259 public boolean isRequestedSessionIdValid() { return false; } 260 public boolean isUserInRole(String role) { return false; } 261 public Principal getUserPrincipal() { return null; } 262 public String getLocalAddr() { return null; } 263 public String getLocalName() { return null; } 264 public int getLocalPort() { return -1; } 265 public int getRemotePort() { return -1; } 266 267 } 268 269 | Popular Tags |