home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-tomcat-addon-1.4.9-installer.exe / servlet-api.jar / javax / servlet / ServletResponseWrapper.class (.txt) < prev    next >
Encoding:
Java Class File  |  2004-08-28  |  2.5 KB  |  90 lines

  1. package javax.servlet;
  2.  
  3. import java.io.IOException;
  4. import java.io.PrintWriter;
  5. import java.util.Locale;
  6.  
  7. public class ServletResponseWrapper implements ServletResponse {
  8.    private ServletResponse response;
  9.  
  10.    public ServletResponseWrapper(ServletResponse response) {
  11.       if (response == null) {
  12.          throw new IllegalArgumentException("Response cannot be null");
  13.       } else {
  14.          this.response = response;
  15.       }
  16.    }
  17.  
  18.    public ServletResponse getResponse() {
  19.       return this.response;
  20.    }
  21.  
  22.    public void setResponse(ServletResponse response) {
  23.       if (response == null) {
  24.          throw new IllegalArgumentException("Response cannot be null");
  25.       } else {
  26.          this.response = response;
  27.       }
  28.    }
  29.  
  30.    public void setCharacterEncoding(String charset) {
  31.       this.response.setCharacterEncoding(charset);
  32.    }
  33.  
  34.    public String getCharacterEncoding() {
  35.       return this.response.getCharacterEncoding();
  36.    }
  37.  
  38.    public ServletOutputStream getOutputStream() throws IOException {
  39.       return this.response.getOutputStream();
  40.    }
  41.  
  42.    public PrintWriter getWriter() throws IOException {
  43.       return this.response.getWriter();
  44.    }
  45.  
  46.    public void setContentLength(int len) {
  47.       this.response.setContentLength(len);
  48.    }
  49.  
  50.    public void setContentType(String type) {
  51.       this.response.setContentType(type);
  52.    }
  53.  
  54.    public String getContentType() {
  55.       return this.response.getContentType();
  56.    }
  57.  
  58.    public void setBufferSize(int size) {
  59.       this.response.setBufferSize(size);
  60.    }
  61.  
  62.    public int getBufferSize() {
  63.       return this.response.getBufferSize();
  64.    }
  65.  
  66.    public void flushBuffer() throws IOException {
  67.       this.response.flushBuffer();
  68.    }
  69.  
  70.    public boolean isCommitted() {
  71.       return this.response.isCommitted();
  72.    }
  73.  
  74.    public void reset() {
  75.       this.response.reset();
  76.    }
  77.  
  78.    public void resetBuffer() {
  79.       this.response.resetBuffer();
  80.    }
  81.  
  82.    public void setLocale(Locale loc) {
  83.       this.response.setLocale(loc);
  84.    }
  85.  
  86.    public Locale getLocale() {
  87.       return this.response.getLocale();
  88.    }
  89. }
  90.