package de.superx.servlet; import java.io.BufferedReader; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.security.Principal; import java.util.Collection; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Vector; import javax.servlet.AsyncContext; import javax.servlet.DispatcherType; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletInputStream; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import javax.servlet.http.Part; import org.apache.commons.fileupload.DiskFileUpload; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUpload; import org.apache.commons.fileupload.FileUploadException; public class CSVServletRequest implements HttpServletRequest { private HttpServletRequest r; private HashMap params = new HashMap(); public CSVServletRequest(HttpServletRequest r, HashMap params) throws FileUploadException { this.r = r; this.params=params; /* * can only be parsed once * if (!FileUpload.isMultipartContent(r)) throw new IllegalArgumentException("Kein multipart Content!"); DiskFileUpload fu = new DiskFileUpload(); List files = fu.parseRequest(r); Iterator iter = files.iterator(); while (iter.hasNext()) { FileItem item = (FileItem) iter.next(); if (item.isFormField()) { params.put(item.getFieldName(), item.getString()); } } */ } public boolean authenticate(HttpServletResponse arg0) throws IOException, ServletException { return r.authenticate(arg0); } public AsyncContext getAsyncContext() { return r.getAsyncContext(); } public Object getAttribute(String arg0) { return r.getAttribute(arg0); } public Enumeration getAttributeNames() { return r.getAttributeNames(); } public String getAuthType() { return r.getAuthType(); } public String getCharacterEncoding() { return r.getCharacterEncoding(); } public int getContentLength() { return r.getContentLength(); } public String getContentType() { return r.getContentType(); } public String getContextPath() { return r.getContextPath(); } public Cookie[] getCookies() { return r.getCookies(); } public long getDateHeader(String arg0) { return r.getDateHeader(arg0); } public DispatcherType getDispatcherType() { return r.getDispatcherType(); } public String getHeader(String arg0) { return r.getHeader(arg0); } public Enumeration getHeaderNames() { return r.getHeaderNames(); } public Enumeration getHeaders(String arg0) { return r.getHeaders(arg0); } public ServletInputStream getInputStream() throws IOException { return r.getInputStream(); } public int getIntHeader(String arg0) { return r.getIntHeader(arg0); } public String getLocalAddr() { return r.getLocalAddr(); } public String getLocalName() { return r.getLocalName(); } public int getLocalPort() { return r.getLocalPort(); } public Locale getLocale() { return r.getLocale(); } public Enumeration getLocales() { return r.getLocales(); } public String getMethod() { return r.getMethod(); } public String getParameter(String arg0) { String result = null; if (params.get(arg0) != null) result = params.get(arg0).toString(); return result; } public Map getParameterMap() { return params; } public Enumeration getParameterNames() { Enumeration x = new Vector(params.keySet()).elements(); return x; } public String[] getParameterValues(String arg0) { String[] res = null; if (params.get(arg0) != null) { res = new String[1]; res[0] = params.get(arg0).toString(); } return res; } public Part getPart(String arg0) throws IOException, IllegalStateException, ServletException { return r.getPart(arg0); } public Collection getParts() throws IOException, IllegalStateException, ServletException { return r.getParts(); } public String getPathInfo() { return r.getPathInfo(); } public String getPathTranslated() { return r.getPathTranslated(); } public String getProtocol() { return r.getProtocol(); } public String getQueryString() { return r.getQueryString(); } public BufferedReader getReader() throws IOException { return r.getReader(); } public String getRealPath(String arg0) { return r.getRealPath(arg0); } public String getRemoteAddr() { return r.getRemoteAddr(); } public String getRemoteHost() { return r.getRemoteHost(); } public int getRemotePort() { return r.getRemotePort(); } public String getRemoteUser() { return r.getRemoteUser(); } public RequestDispatcher getRequestDispatcher(String arg0) { return r.getRequestDispatcher(arg0); } public String getRequestURI() { return r.getRequestURI(); } public StringBuffer getRequestURL() { return r.getRequestURL(); } public String getRequestedSessionId() { return r.getRequestedSessionId(); } public String getScheme() { return r.getScheme(); } public String getServerName() { return r.getServerName(); } public int getServerPort() { return r.getServerPort(); } public ServletContext getServletContext() { return r.getServletContext(); } public String getServletPath() { return r.getServletPath(); } public HttpSession getSession() { return r.getSession(); } public HttpSession getSession(boolean arg0) { return r.getSession(arg0); } public Principal getUserPrincipal() { return r.getUserPrincipal(); } public boolean isAsyncStarted() { return r.isAsyncStarted(); } public boolean isAsyncSupported() { return r.isAsyncSupported(); } public boolean isRequestedSessionIdFromCookie() { return r.isRequestedSessionIdFromCookie(); } public boolean isRequestedSessionIdFromURL() { return r.isRequestedSessionIdFromURL(); } public boolean isRequestedSessionIdFromUrl() { return r.isRequestedSessionIdFromUrl(); } public boolean isRequestedSessionIdValid() { return r.isRequestedSessionIdValid(); } public boolean isSecure() { return r.isSecure(); } public boolean isUserInRole(String arg0) { return r.isUserInRole(arg0); } public void login(String arg0, String arg1) throws ServletException { r.login(arg0, arg1); } public void logout() throws ServletException { r.logout(); } public void removeAttribute(String arg0) { r.removeAttribute(arg0); } public void setAttribute(String arg0, Object arg1) { r.setAttribute(arg0, arg1); } public void setCharacterEncoding(String arg0) throws UnsupportedEncodingException { r.setCharacterEncoding(arg0); } public AsyncContext startAsync() { return r.startAsync(); } public AsyncContext startAsync(ServletRequest arg0, ServletResponse arg1) { return r.startAsync(arg0, arg1); } }