home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 April / DPPCPRO0499.ISO / April / Notes / 50b2wic.exe / DATA1.CAB / NotesProgramFilesJavaSupport / icsclass.jar / javax / servlet / http / NoBodyResponse.class (.txt) < prev   
Encoding:
Java Class File  |  1998-11-15  |  2.7 KB  |  101 lines

  1. package javax.servlet.http;
  2.  
  3. import java.io.IOException;
  4. import java.io.OutputStreamWriter;
  5. import java.io.PrintWriter;
  6. import java.io.UnsupportedEncodingException;
  7. import javax.servlet.ServletOutputStream;
  8.  
  9. class NoBodyResponse implements HttpServletResponse {
  10.    private HttpServletResponse resp;
  11.    private NoBodyOutputStream noBody;
  12.    private PrintWriter writer;
  13.    private boolean didSetContentLength;
  14.  
  15.    NoBodyResponse(HttpServletResponse var1) {
  16.       this.resp = var1;
  17.       this.noBody = new NoBodyOutputStream();
  18.    }
  19.  
  20.    void setContentLength() {
  21.       if (!this.didSetContentLength) {
  22.          this.resp.setContentLength(this.noBody.getContentLength());
  23.       }
  24.  
  25.    }
  26.  
  27.    public void setContentLength(int var1) {
  28.       this.resp.setContentLength(var1);
  29.       this.didSetContentLength = true;
  30.    }
  31.  
  32.    public void setContentType(String var1) {
  33.       this.resp.setContentType(var1);
  34.    }
  35.  
  36.    public ServletOutputStream getOutputStream() throws IOException {
  37.       return this.noBody;
  38.    }
  39.  
  40.    public String getCharacterEncoding() {
  41.       return this.resp.getCharacterEncoding();
  42.    }
  43.  
  44.    public PrintWriter getWriter() throws UnsupportedEncodingException {
  45.       if (this.writer == null) {
  46.          OutputStreamWriter var1 = new OutputStreamWriter(this.noBody, this.getCharacterEncoding());
  47.          this.writer = new PrintWriter(var1);
  48.       }
  49.  
  50.       return this.writer;
  51.    }
  52.  
  53.    public void addCookie(Cookie var1) {
  54.       this.resp.addCookie(var1);
  55.    }
  56.  
  57.    public boolean containsHeader(String var1) {
  58.       return this.resp.containsHeader(var1);
  59.    }
  60.  
  61.    public void setStatus(int var1, String var2) {
  62.       this.resp.setStatus(var1, var2);
  63.    }
  64.  
  65.    public void setStatus(int var1) {
  66.       this.resp.setStatus(var1);
  67.    }
  68.  
  69.    public void setHeader(String var1, String var2) {
  70.       this.resp.setHeader(var1, var2);
  71.    }
  72.  
  73.    public void setIntHeader(String var1, int var2) {
  74.       this.resp.setIntHeader(var1, var2);
  75.    }
  76.  
  77.    public void setDateHeader(String var1, long var2) {
  78.       this.resp.setDateHeader(var1, var2);
  79.    }
  80.  
  81.    public void sendError(int var1, String var2) throws IOException {
  82.       this.resp.sendError(var1, var2);
  83.    }
  84.  
  85.    public void sendError(int var1) throws IOException {
  86.       this.resp.sendError(var1);
  87.    }
  88.  
  89.    public void sendRedirect(String var1) throws IOException {
  90.       this.resp.sendRedirect(var1);
  91.    }
  92.  
  93.    public String encodeUrl(String var1) {
  94.       return this.resp.encodeUrl(var1);
  95.    }
  96.  
  97.    public String encodeRedirectUrl(String var1) {
  98.       return this.resp.encodeRedirectUrl(var1);
  99.    }
  100. }
  101.