KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > params > DummyServletRequestWrapper


1 package org.jahia.params;
2
3 import java.io.BufferedReader JavaDoc;
4 import java.io.IOException JavaDoc;
5 import java.io.Serializable JavaDoc;
6 import java.io.UnsupportedEncodingException JavaDoc;
7 import java.security.Principal JavaDoc;
8 import java.util.Enumeration JavaDoc;
9 import java.util.HashMap JavaDoc;
10 import java.util.Locale JavaDoc;
11 import java.util.Map JavaDoc;
12 import java.util.Vector JavaDoc;
13
14 import javax.servlet.RequestDispatcher JavaDoc;
15 import javax.servlet.ServletInputStream JavaDoc;
16 import javax.servlet.http.Cookie JavaDoc;
17 import javax.servlet.http.HttpServletRequest JavaDoc;
18 import javax.servlet.http.HttpSession JavaDoc;
19
20 import org.jahia.services.usermanager.JahiaUser;
21
22 /**
23  * Created by IntelliJ IDEA.
24  * User: hollis
25  * Date: 25 mai 2005
26  * Time: 10:15:17
27  * To change this template use File | Settings | File Templates.
28  */

29 public class DummyServletRequestWrapper implements HttpServletRequest JavaDoc, Serializable JavaDoc {
30
31     private JahiaUser user;
32
33     public DummyServletRequestWrapper(JahiaUser theUser){
34         this.user = theUser;
35     }
36
37     public Object JavaDoc getAttribute(String JavaDoc s){
38         return null;
39     }
40
41     public Enumeration JavaDoc getAttributeNames(){
42         return new Vector JavaDoc().elements();
43     }
44
45     public String JavaDoc getCharacterEncoding(){
46         return "";
47     }
48
49     public void setCharacterEncoding(String JavaDoc s)
50             throws UnsupportedEncodingException JavaDoc{
51         throw new UnsupportedEncodingException JavaDoc("Not allowed method call");
52     }
53
54     public int getContentLength(){
55         return 0;
56     }
57
58     public String JavaDoc getContentType(){
59         return "";
60     }
61
62     public ServletInputStream JavaDoc getInputStream() throws IOException JavaDoc {
63         throw new IOException JavaDoc("Not allowed method call");
64     }
65
66     public String JavaDoc getParameter(String JavaDoc s){
67         return null;
68     }
69
70     public Enumeration JavaDoc getParameterNames(){
71         return new Vector JavaDoc().elements();
72     }
73
74     public String JavaDoc[] getParameterValues(String JavaDoc s){
75         return new String JavaDoc[]{};
76     }
77
78     public Map JavaDoc getParameterMap(){
79         return new HashMap JavaDoc();
80     }
81
82     public String JavaDoc getProtocol(){
83         return "";
84     }
85
86     public String JavaDoc getScheme(){
87         return "";
88     }
89
90     public String JavaDoc getServerName(){
91         return "";
92     }
93
94     public int getServerPort(){
95         return 0;
96     }
97
98     public BufferedReader JavaDoc getReader() throws IOException JavaDoc {
99         throw new IOException JavaDoc("Not allowed method call");
100     }
101
102     public String JavaDoc getRemoteAddr(){
103         return "";
104     }
105
106     public String JavaDoc getRemoteHost(){
107         return "";
108     }
109
110     public void setAttribute(String JavaDoc s, Object JavaDoc o){
111     }
112
113     public void removeAttribute(String JavaDoc s){
114
115     }
116
117     public Locale JavaDoc getLocale(){
118         return null;
119     }
120
121     public Enumeration JavaDoc getLocales(){
122         return new Vector JavaDoc().elements();
123     }
124
125     public boolean isSecure(){
126         return false;
127     }
128
129     public RequestDispatcher JavaDoc getRequestDispatcher(String JavaDoc s){
130         return null;
131     }
132
133     /**
134      * @deprecated
135      */

136     public String JavaDoc getRealPath(String JavaDoc s){
137         return "";
138     }
139
140
141
142     public String JavaDoc getAuthType(){
143         return "";
144     }
145
146     public Cookie JavaDoc[] getCookies(){
147         return new Cookie JavaDoc[]{};
148     }
149
150     public long getDateHeader(String JavaDoc s){
151         return 0;
152     }
153
154     public String JavaDoc getHeader(String JavaDoc s){
155         return "";
156     }
157
158     public Enumeration JavaDoc getHeaders(String JavaDoc s){
159         return new Vector JavaDoc().elements();
160     }
161
162     public Enumeration JavaDoc getHeaderNames(){
163         return new Vector JavaDoc().elements();
164     }
165
166     public int getIntHeader(String JavaDoc s){
167         return 0;
168     }
169
170     public String JavaDoc getMethod(){
171         return "";
172     }
173
174     public String JavaDoc getPathInfo(){
175         return "";
176     }
177
178     public String JavaDoc getPathTranslated(){
179         return "";
180     }
181
182     public String JavaDoc getContextPath(){
183         return "";
184     }
185
186     public String JavaDoc getQueryString(){
187         return "";
188     }
189
190     public String JavaDoc getRemoteUser(){
191         return "";
192     }
193
194     public boolean isUserInRole(String JavaDoc s){
195         return false;
196     }
197
198     public Principal JavaDoc getUserPrincipal(){
199         return this.user;
200     }
201
202     public String JavaDoc getRequestedSessionId(){
203         return "";
204     }
205
206     public String JavaDoc getRequestURI(){
207         return "";
208     }
209
210     public StringBuffer JavaDoc getRequestURL(){
211         return new StringBuffer JavaDoc();
212     }
213
214     public String JavaDoc getServletPath(){
215         return "";
216     }
217
218     public HttpSession JavaDoc getSession(boolean b){
219         return null;
220     }
221
222     public HttpSession JavaDoc getSession(){
223         return null;
224     }
225
226     public boolean isRequestedSessionIdValid(){
227         return false;
228     }
229
230     public boolean isRequestedSessionIdFromCookie(){
231         return false;
232     }
233
234     public boolean isRequestedSessionIdFromURL(){
235         return false;
236     }
237
238     /**
239      * @deprecated
240      */

241     public boolean isRequestedSessionIdFromUrl(){
242         return false;
243     }
244
245     public String JavaDoc getLocalAddr(){
246       return "";
247     }
248     
249     public String JavaDoc getLocalName(){
250       return "";
251     }
252     
253     public int getLocalPort(){
254       return 0;
255     }
256     
257     public int getRemotePort(){
258       return 0;
259     }
260 }
261
Popular Tags