1 28 29 package com.caucho.server.connection; 30 31 import javax.servlet.RequestDispatcher ; 32 import javax.servlet.ServletInputStream ; 33 import javax.servlet.ServletRequest ; 34 import javax.servlet.http.Cookie ; 35 import javax.servlet.http.HttpServletRequest ; 36 import javax.servlet.http.HttpSession ; 37 import java.io.BufferedReader ; 38 import java.io.IOException ; 39 import java.io.UnsupportedEncodingException ; 40 import java.security.Principal ; 41 import java.util.Enumeration ; 42 import java.util.Locale ; 43 import java.util.Map ; 44 45 53 public class RequestWrapper implements ServletRequest { 54 protected HttpServletRequest _request; 56 57 60 public RequestWrapper() 61 { 62 } 63 64 67 public RequestWrapper(HttpServletRequest request) 68 { 69 _request = request; 70 } 71 72 77 public void setRequest(HttpServletRequest request) 78 { 79 _request = request; 80 } 81 82 87 public HttpServletRequest getRequest() 88 { 89 return _request; 90 } 91 94 public String getProtocol() 95 { 96 return _request.getProtocol(); 97 } 98 101 public String getScheme() 102 { 103 return _request.getScheme(); 104 } 105 109 public String getServerName() 110 { 111 return _request.getServerName(); 112 } 113 116 public int getServerPort() 117 { 118 return _request.getServerPort(); 119 } 120 123 public String getRemoteAddr() 124 { 125 return _request.getRemoteAddr(); 126 } 127 128 131 public String getRemoteHost() 132 { 133 return _request.getRemoteHost(); 134 } 135 136 141 public int getRemotePort() 142 { 143 return _request.getRemotePort(); 144 } 145 146 149 public String getLocalAddr() 150 { 151 return _request.getLocalAddr(); 152 } 153 154 157 public String getLocalName() 158 { 159 return _request.getLocalName(); 160 } 161 162 165 public int getLocalPort() 166 { 167 return _request.getLocalPort(); 168 } 169 170 180 public String getParameter(String name) 181 { 182 return _request.getParameter(name); 183 } 184 188 public Map getParameterMap() 189 { 190 return _request.getParameterMap(); 191 } 192 202 public String []getParameterValues(String name) 203 { 204 return _request.getParameterValues(name); 205 } 206 217 public Enumeration getParameterNames() 218 { 219 return _request.getParameterNames(); 220 } 221 226 public ServletInputStream getInputStream() 227 throws IOException 228 { 229 return _request.getInputStream(); 230 } 231 236 public BufferedReader getReader() 237 throws IOException , IllegalStateException 238 { 239 return _request.getReader(); 240 } 241 244 public String getCharacterEncoding() 245 { 246 return _request.getCharacterEncoding(); 247 } 248 251 public void setCharacterEncoding(String encoding) 252 throws UnsupportedEncodingException 253 { 254 _request.setCharacterEncoding(encoding); 255 } 256 265 public int getContentLength() 266 { 267 return _request.getContentLength(); 268 } 269 272 public String getContentType() 273 { 274 return _request.getContentType(); 275 } 276 279 public Locale getLocale() 280 { 281 return _request.getLocale(); 282 } 283 286 public Enumeration getLocales() 287 { 288 return _request.getLocales(); 289 } 290 293 public boolean isSecure() 294 { 295 return _request.isSecure(); 296 } 297 303 public Object getAttribute(String name) 304 { 305 return _request.getAttribute(name); 306 } 307 313 public void setAttribute(String name, Object o) 314 { 315 _request.setAttribute(name, o); 316 } 317 320 public Enumeration getAttributeNames() 321 { 322 return _request.getAttributeNames(); 323 } 324 329 public void removeAttribute(String name) 330 { 331 _request.removeAttribute(name); 332 } 333 353 public RequestDispatcher getRequestDispatcher(String uri) 354 { 355 return _request.getRequestDispatcher(uri); 356 } 357 358 361 public String getRealPath(String uri) 362 { 363 return _request.getRealPath(uri); 364 } 365 366 371 public String getMethod() 372 { 373 return _request.getMethod(); 374 } 375 378 public String getRequestURI() 379 { 380 return _request.getRequestURI(); 381 } 382 387 public StringBuffer getRequestURL() 388 { 389 return _request.getRequestURL(); 390 } 391 399 public String getContextPath() 400 { 401 return _request.getContextPath(); 402 } 403 415 public String getServletPath() 416 { 417 return _request.getServletPath(); 418 } 419 431 public String getPathInfo() 432 { 433 return _request.getPathInfo(); 434 } 435 442 public String getPathTranslated() 443 { 444 return _request.getPathTranslated(); 445 } 446 452 public String getQueryString() 453 { 454 return _request.getQueryString(); 455 } 456 468 public String getHeader(String name) 469 { 470 return _request.getHeader(name); 471 } 472 479 public Enumeration getHeaders(String name) 480 { 481 return _request.getHeaders(name); 482 } 483 486 public Enumeration getHeaderNames() 487 { 488 return _request.getHeaderNames(); 489 } 490 496 public int getIntHeader(String name) 497 { 498 return _request.getIntHeader(name); 499 } 500 510 public long getDateHeader(String name) 511 { 512 return _request.getDateHeader(name); 513 } 514 517 public Cookie []getCookies() 518 { 519 return _request.getCookies(); 520 } 521 527 public HttpSession getSession(boolean create) 528 { 529 return _request.getSession(create); 530 } 531 536 public HttpSession getSession() 537 { 538 return getSession(true); 539 } 540 546 public String getRequestedSessionId() 547 { 548 return _request.getRequestedSessionId(); 549 } 550 553 public boolean isRequestedSessionIdValid() 554 { 555 return _request.isRequestedSessionIdValid(); 556 } 557 560 public boolean isRequestedSessionIdFromCookie() 561 { 562 return _request.isRequestedSessionIdFromCookie(); 563 } 564 567 public boolean isRequestedSessionIdFromURL() 568 { 569 return _request.isRequestedSessionIdFromURL(); 570 } 571 574 public String getAuthType() 575 { 576 return _request.getAuthType(); 577 } 578 581 public String getRemoteUser() 582 { 583 return _request.getRemoteUser(); 584 } 585 588 public boolean isUserInRole(String role) 589 { 590 return _request.isUserInRole(role); 591 } 592 593 596 public Principal getUserPrincipal() 597 { 598 return _request.getUserPrincipal(); 599 } 600 601 604 public boolean isRequestedSessionIdFromUrl() 605 { 606 return _request.isRequestedSessionIdFromUrl(); 607 } 608 609 612 protected void free() 613 { 614 _request = null; 615 } 616 } 617 | Popular Tags |