1 28 29 package com.caucho.server.connection; 30 31 import javax.servlet.ServletOutputStream ; 32 import javax.servlet.ServletResponse ; 33 import javax.servlet.http.Cookie ; 34 import javax.servlet.http.HttpServletResponse ; 35 import java.io.IOException ; 36 import java.io.PrintWriter ; 37 import java.util.Locale ; 38 39 47 public class ResponseWrapper implements ServletResponse { 48 protected HttpServletResponse _response; 50 51 56 public ResponseWrapper() 57 { 58 } 59 60 65 public ResponseWrapper(HttpServletResponse response) 66 { 67 _response = response; 68 } 69 70 75 public void setResponse(HttpServletResponse response) 76 { 77 _response = response; 78 } 79 80 85 public ServletResponse getResponse() 86 { 87 return _response; 88 } 89 90 105 public void setContentType(String type) 106 { 107 _response.setContentType(type); 108 } 109 110 115 public String getContentType() 116 { 117 return _response.getContentType(); 118 } 119 120 123 public String getCharacterEncoding() 124 { 125 return _response.getCharacterEncoding(); 126 } 127 128 133 public void setCharacterEncoding(String encoding) 134 { 135 _response.setCharacterEncoding(encoding); 136 } 137 138 143 public void setLocale(Locale locale) 144 { 145 _response.setLocale(locale); 146 } 147 150 public Locale getLocale() 151 { 152 return _response.getLocale(); 153 } 154 158 public ServletOutputStream getOutputStream() 159 throws IOException 160 { 161 return _response.getOutputStream(); 162 } 163 167 public PrintWriter getWriter() 168 throws IOException 169 { 170 return _response.getWriter(); 171 } 172 178 public void setBufferSize(int size) 179 { 180 _response.setBufferSize(size); 181 } 182 185 public int getBufferSize() 186 { 187 return _response.getBufferSize(); 188 } 189 192 public void flushBuffer() 193 throws IOException 194 { 195 _response.flushBuffer(); 196 } 197 201 public boolean isCommitted() 202 { 203 return _response.isCommitted(); 204 } 205 206 212 public void reset() 213 { 214 _response.reset(); 215 } 216 217 224 public void resetBuffer() 225 { 226 _response.resetBuffer(); 227 } 228 234 public void setContentLength(int len) 235 { 236 _response.setContentLength(len); 237 } 238 239 244 public void setStatus(int sc) 245 { 246 _response.setStatus(sc); 247 } 248 253 public void sendError(int sc, String msg) 254 throws IOException 255 { 256 _response.sendError(sc, msg); 257 } 258 263 public void sendError(int sc) 264 throws IOException 265 { 266 _response.sendError(sc); 267 } 268 273 public void sendRedirect(String location) 274 throws IOException 275 { 276 _response.sendRedirect(location); 277 } 278 285 public void setHeader(String name, String value) 286 { 287 _response.setHeader(name, value); 288 } 289 296 public void addHeader(String name, String value) 297 { 298 _response.addHeader(name, value); 299 } 300 305 public boolean containsHeader(String name) 306 { 307 return _response.containsHeader(name); 308 } 309 321 public void setDateHeader(String name, long date) 322 { 323 _response.setDateHeader(name, date); 324 } 325 331 public void addDateHeader(String name, long date) 332 { 333 _response.addDateHeader(name, date); 334 } 335 341 public void setIntHeader(String name, int value) 342 { 343 _response.setIntHeader(name, value); 344 } 345 351 public void addIntHeader(String name, int value) 352 { 353 _response.addIntHeader(name, value); 354 } 355 358 public void addCookie(Cookie cookie) 359 { 360 _response.addCookie(cookie); 361 } 362 369 public String encodeURL(String url) 370 { 371 return _response.encodeURL(url); 372 } 373 380 public String encodeRedirectURL(String name) 381 { 382 return _response.encodeRedirectURL(name); 383 } 384 385 public void setStatus(int sc, String msg) 386 { 387 _response.setStatus(sc, msg); 388 } 389 392 public String encodeUrl(String url) 393 { 394 return encodeURL(url); 395 } 396 399 public String encodeRedirectUrl(String url) 400 { 401 return encodeRedirectURL(url); 402 } 403 } 404 | Popular Tags |