KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > server > connection > StubServletResponse


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.server.connection;
30
31 import com.caucho.vfs.WriteStream;
32
33 import javax.servlet.http.Cookie JavaDoc;
34 import java.io.IOException JavaDoc;
35 import java.util.Locale JavaDoc;
36
37 // Is there anything at all useful that could be put here?
38
public class StubServletResponse extends AbstractHttpResponse {
39   public StubServletResponse()
40   {
41     try {
42       start();
43     } catch (Throwable JavaDoc e) {
44     }
45   }
46   
47   public String JavaDoc getCharacterEncoding()
48   {
49     return "ISO-8859-1";
50   }
51   
52   public void setLocale(Locale JavaDoc locale)
53   {
54   }
55   
56   public Locale JavaDoc getLocale()
57   {
58     return null;
59   }
60   
61   public boolean writeHeadersInt(WriteStream out, int length)
62   {
63     return false;
64   }
65
66   public void setBufferSize(int size)
67   {
68   }
69   
70   public int getBufferSize()
71   {
72     return 0;
73   }
74   
75   public void flushBuffer()
76   {
77   }
78   
79   public boolean isCommitted()
80   {
81     return false;
82   }
83   
84   public void reset()
85   {
86   }
87   
88   public void resetBuffer()
89   {
90   }
91   
92   public void setContentLength(int length)
93   {
94   }
95   
96   public void setContentType(String JavaDoc type)
97   {
98   }
99
100   public void setStatus(int status)
101   {
102   }
103   
104   public void setStatus(int status, String JavaDoc messages)
105   {
106   }
107   
108   public void sendRedirect(String JavaDoc location)
109   {
110   }
111   
112   public void sendError(int i)
113   {
114   }
115   
116   public void sendError(int i, String JavaDoc message)
117   {
118   }
119     
120   public String JavaDoc encodeUrl(String JavaDoc url)
121   {
122     return url;
123   }
124   
125   public String JavaDoc encodeURL(String JavaDoc url)
126   {
127     return url;
128   }
129   
130   public String JavaDoc encodeRedirectUrl(String JavaDoc url)
131   {
132     return url;
133   }
134   
135   public String JavaDoc encodeRedirectURL(String JavaDoc url)
136   {
137     return url;
138   }
139
140   public void addCookie(Cookie JavaDoc cookie)
141   {
142   }
143   
144   public boolean containsHeader(String JavaDoc header)
145   {
146     return false;
147   }
148   
149   public void setHeader(String JavaDoc header, String JavaDoc value)
150   {
151   }
152   
153   public void setIntHeader(String JavaDoc header, int value)
154   {
155   }
156   
157   public void setDateHeader(String JavaDoc header, long value)
158   {
159   }
160   
161   public void addHeader(String JavaDoc header, String JavaDoc value)
162   {
163   }
164   
165   public void addIntHeader(String JavaDoc header, int value)
166   {
167   }
168   
169   public void addDateHeader(String JavaDoc header, long value)
170   {
171   }
172
173   public String JavaDoc getHeader(String JavaDoc key)
174   {
175     return null;
176   }
177   
178   public void clearBuffer()
179   {
180   }
181   
182   public void close() throws IOException JavaDoc
183   {
184   }
185
186   public boolean disableHeaders(boolean disable)
187   {
188     return false;
189   }
190
191   public int getRemaining()
192   {
193     return 0;
194   }
195
196   public void setForbidForward(boolean forbid)
197   {
198   }
199   
200   public boolean getForbidForward()
201   {
202     return false;
203   }
204   
205   public void setHasError(boolean hasError)
206   {
207   }
208   
209   public boolean hasError()
210   {
211     return true;
212   }
213   
214   public void killCache()
215   {
216   }
217   
218   public void setPrivateCache(boolean isPrivate)
219   {
220   }
221   
222   public void setSessionId(String JavaDoc id)
223   {
224   }
225 }
226
Popular Tags