1 package org.jahia.params; 2 3 import java.io.BufferedReader ; 4 import java.io.IOException ; 5 import java.io.Serializable ; 6 import java.io.UnsupportedEncodingException ; 7 import java.security.Principal ; 8 import java.util.Enumeration ; 9 import java.util.HashMap ; 10 import java.util.Locale ; 11 import java.util.Map ; 12 import java.util.Vector ; 13 14 import javax.servlet.RequestDispatcher ; 15 import javax.servlet.ServletInputStream ; 16 import javax.servlet.http.Cookie ; 17 import javax.servlet.http.HttpServletRequest ; 18 import javax.servlet.http.HttpSession ; 19 20 import org.jahia.services.usermanager.JahiaUser; 21 22 29 public class DummyServletRequestWrapper implements HttpServletRequest , Serializable { 30 31 private JahiaUser user; 32 33 public DummyServletRequestWrapper(JahiaUser theUser){ 34 this.user = theUser; 35 } 36 37 public Object getAttribute(String s){ 38 return null; 39 } 40 41 public Enumeration getAttributeNames(){ 42 return new Vector ().elements(); 43 } 44 45 public String getCharacterEncoding(){ 46 return ""; 47 } 48 49 public void setCharacterEncoding(String s) 50 throws UnsupportedEncodingException { 51 throw new UnsupportedEncodingException ("Not allowed method call"); 52 } 53 54 public int getContentLength(){ 55 return 0; 56 } 57 58 public String getContentType(){ 59 return ""; 60 } 61 62 public ServletInputStream getInputStream() throws IOException { 63 throw new IOException ("Not allowed method call"); 64 } 65 66 public String getParameter(String s){ 67 return null; 68 } 69 70 public Enumeration getParameterNames(){ 71 return new Vector ().elements(); 72 } 73 74 public String [] getParameterValues(String s){ 75 return new String []{}; 76 } 77 78 public Map getParameterMap(){ 79 return new HashMap (); 80 } 81 82 public String getProtocol(){ 83 return ""; 84 } 85 86 public String getScheme(){ 87 return ""; 88 } 89 90 public String getServerName(){ 91 return ""; 92 } 93 94 public int getServerPort(){ 95 return 0; 96 } 97 98 public BufferedReader getReader() throws IOException { 99 throw new IOException ("Not allowed method call"); 100 } 101 102 public String getRemoteAddr(){ 103 return ""; 104 } 105 106 public String getRemoteHost(){ 107 return ""; 108 } 109 110 public void setAttribute(String s, Object o){ 111 } 112 113 public void removeAttribute(String s){ 114 115 } 116 117 public Locale getLocale(){ 118 return null; 119 } 120 121 public Enumeration getLocales(){ 122 return new Vector ().elements(); 123 } 124 125 public boolean isSecure(){ 126 return false; 127 } 128 129 public RequestDispatcher getRequestDispatcher(String s){ 130 return null; 131 } 132 133 136 public String getRealPath(String s){ 137 return ""; 138 } 139 140 141 142 public String getAuthType(){ 143 return ""; 144 } 145 146 public Cookie [] getCookies(){ 147 return new Cookie []{}; 148 } 149 150 public long getDateHeader(String s){ 151 return 0; 152 } 153 154 public String getHeader(String s){ 155 return ""; 156 } 157 158 public Enumeration getHeaders(String s){ 159 return new Vector ().elements(); 160 } 161 162 public Enumeration getHeaderNames(){ 163 return new Vector ().elements(); 164 } 165 166 public int getIntHeader(String s){ 167 return 0; 168 } 169 170 public String getMethod(){ 171 return ""; 172 } 173 174 public String getPathInfo(){ 175 return ""; 176 } 177 178 public String getPathTranslated(){ 179 return ""; 180 } 181 182 public String getContextPath(){ 183 return ""; 184 } 185 186 public String getQueryString(){ 187 return ""; 188 } 189 190 public String getRemoteUser(){ 191 return ""; 192 } 193 194 public boolean isUserInRole(String s){ 195 return false; 196 } 197 198 public Principal getUserPrincipal(){ 199 return this.user; 200 } 201 202 public String getRequestedSessionId(){ 203 return ""; 204 } 205 206 public String getRequestURI(){ 207 return ""; 208 } 209 210 public StringBuffer getRequestURL(){ 211 return new StringBuffer (); 212 } 213 214 public String getServletPath(){ 215 return ""; 216 } 217 218 public HttpSession getSession(boolean b){ 219 return null; 220 } 221 222 public HttpSession 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 241 public boolean isRequestedSessionIdFromUrl(){ 242 return false; 243 } 244 245 public String getLocalAddr(){ 246 return ""; 247 } 248 249 public String 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 |