1 16 package org.outerj.daisy.httpconnector; 17 18 import org.mortbay.http.HttpRequest; 19 20 import javax.servlet.http.HttpServletRequest ; 21 import javax.servlet.http.Cookie ; 22 import javax.servlet.http.HttpSession ; 23 import javax.servlet.RequestDispatcher ; 24 import javax.servlet.ServletInputStream ; 25 import java.io.BufferedReader ; 26 import java.io.IOException ; 27 import java.io.UnsupportedEncodingException ; 28 import java.io.InputStream ; 29 import java.util.Enumeration ; 30 import java.util.Map ; 31 import java.util.Locale ; 32 import java.security.Principal ; 33 34 39 public class RequestWrapper implements HttpServletRequest { 40 private HttpRequest jettyRequest; 41 42 public RequestWrapper(HttpRequest jettyRequest) { 43 this.jettyRequest = jettyRequest; 44 } 45 46 public BufferedReader getReader() throws IOException { 47 throw new RuntimeException ("Method not implemented"); 48 } 49 50 public String [] getParameterValues(String string) { 51 throw new RuntimeException ("Method not implemented"); 52 } 53 54 public void setCharacterEncoding(String string) throws UnsupportedEncodingException { 55 throw new RuntimeException ("Method not implemented"); 56 } 57 58 public String getCharacterEncoding() { 59 throw new RuntimeException ("Method not implemented"); 60 } 61 62 public boolean isSecure() { 63 throw new RuntimeException ("Method not implemented"); 64 } 65 66 public void setAttribute(String string, Object object) { 67 throw new RuntimeException ("Method not implemented"); 68 } 69 70 public void removeAttribute(String string) { 71 throw new RuntimeException ("Method not implemented"); 72 } 73 74 public Enumeration getAttributeNames() { 75 throw new RuntimeException ("Method not implemented"); 76 } 77 78 public String getContentType() { 79 throw new RuntimeException ("Method not implemented"); 80 } 81 82 public String getParameter(String string) { 83 throw new RuntimeException ("Method not implemented"); 84 } 85 86 public RequestDispatcher getRequestDispatcher(String string) { 87 throw new RuntimeException ("Method not implemented"); 88 } 89 90 public String getRemoteAddr() { 91 throw new RuntimeException ("Method not implemented"); 92 } 93 94 public String getRemoteHost() { 95 throw new RuntimeException ("Method not implemented"); 96 } 97 98 public String getRealPath(String string) { 99 throw new RuntimeException ("Method not implemented"); 100 } 101 102 public int getContentLength() { 103 return jettyRequest.getContentLength(); 104 } 105 106 public String getProtocol() { 107 throw new RuntimeException ("Method not implemented"); 108 } 109 110 public int getServerPort() { 111 throw new RuntimeException ("Method not implemented"); 112 } 113 114 public Object getAttribute(String string) { 115 throw new RuntimeException ("Method not implemented"); 116 } 117 118 public Map getParameterMap() { 119 throw new RuntimeException ("Method not implemented"); 120 } 121 122 public Enumeration getLocales() { 123 throw new RuntimeException ("Method not implemented"); 124 } 125 126 public String getServerName() { 127 throw new RuntimeException ("Method not implemented"); 128 } 129 130 public ServletInputStream getInputStream() throws IOException { 131 return new ServletInputStreamWrapper(jettyRequest.getInputStream()); 132 } 133 134 public Locale getLocale() { 135 throw new RuntimeException ("Method not implemented"); 136 } 137 138 public Enumeration getParameterNames() { 139 throw new RuntimeException ("Method not implemented"); 140 } 141 142 public String getScheme() { 143 throw new RuntimeException ("Method not implemented"); 144 } 145 146 public long getDateHeader(String string) { 147 throw new RuntimeException ("Method not implemented"); 148 } 149 150 public String getRemoteUser() { 151 throw new RuntimeException ("Method not implemented"); 152 } 153 154 public String getQueryString() { 155 throw new RuntimeException ("Method not implemented"); 156 } 157 158 public boolean isUserInRole(String string) { 159 throw new RuntimeException ("Method not implemented"); 160 } 161 162 public String getRequestedSessionId() { 163 throw new RuntimeException ("Method not implemented"); 164 } 165 166 public boolean isRequestedSessionIdValid() { 167 throw new RuntimeException ("Method not implemented"); 168 } 169 170 public String getHeader(String name) { 171 return jettyRequest.getField(name); 172 } 173 174 public Cookie [] getCookies() { 175 throw new RuntimeException ("Method not implemented"); 176 } 177 178 public boolean isRequestedSessionIdFromURL() { 179 throw new RuntimeException ("Method not implemented"); 180 } 181 182 public boolean isRequestedSessionIdFromCookie() { 183 throw new RuntimeException ("Method not implemented"); 184 } 185 186 public String getServletPath() { 187 throw new RuntimeException ("Method not implemented"); 188 } 189 190 public String getMethod() { 191 throw new RuntimeException ("Method not implemented"); 192 } 193 194 public Enumeration getHeaders(String string) { 195 throw new RuntimeException ("Method not implemented"); 196 } 197 198 public String getPathInfo() { 199 throw new RuntimeException ("Method not implemented"); 200 } 201 202 public Enumeration getHeaderNames() { 203 throw new RuntimeException ("Method not implemented"); 204 } 205 206 public String getContextPath() { 207 throw new RuntimeException ("Method not implemented"); 208 } 209 210 public int getIntHeader(String string) { 211 throw new RuntimeException ("Method not implemented"); 212 } 213 214 public String getRequestURI() { 215 throw new RuntimeException ("Method not implemented"); 216 } 217 218 public HttpSession getSession(boolean b) { 219 throw new RuntimeException ("Method not implemented"); 220 } 221 222 public HttpSession getSession() { 223 throw new RuntimeException ("Method not implemented"); 224 } 225 226 public boolean isRequestedSessionIdFromUrl() { 227 throw new RuntimeException ("Method not implemented"); 228 } 229 230 public String getAuthType() { 231 throw new RuntimeException ("Method not implemented"); 232 } 233 234 public Principal getUserPrincipal() { 235 throw new RuntimeException ("Method not implemented"); 236 } 237 238 public StringBuffer getRequestURL() { 239 throw new RuntimeException ("Method not implemented"); 240 } 241 242 public String getPathTranslated() { 243 throw new RuntimeException ("Method not implemented"); 244 } 245 246 static class ServletInputStreamWrapper extends ServletInputStream { 247 private InputStream inputStream; 248 249 public ServletInputStreamWrapper(InputStream inputStream) { 250 this.inputStream = inputStream; 251 } 252 253 public synchronized void mark(int readlimit) { 254 inputStream.mark(readlimit); 255 } 256 257 public void close() throws IOException { 258 inputStream.close(); 259 } 260 261 public synchronized void reset() throws IOException { 262 inputStream.reset(); 263 } 264 265 public int available() throws IOException { 266 return inputStream.available(); 267 } 268 269 public boolean markSupported() { 270 return inputStream.markSupported(); 271 } 272 273 public long skip(long n) throws IOException { 274 return inputStream.skip(n); 275 } 276 277 public int read(byte b[]) throws IOException { 278 return inputStream.read(b); 279 } 280 281 public int read(byte b[], int off, int len) throws IOException { 282 return inputStream.read(b, off, len); 283 } 284 285 public int read() throws IOException { 286 return inputStream.read(); 287 } 288 } 289 } 290 | Popular Tags |