/[Apache-SVN]/cocoon/trunk/src/java/org/apache/cocoon/servlet/multipart/MultipartHttpServletRequest.java
ViewVC logotype

Diff of /cocoon/trunk/src/java/org/apache/cocoon/servlet/multipart/MultipartHttpServletRequest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- cocoon/trunk/src/java/org/apache/cocoon/servlet/multipart/MultipartHttpServletRequest.java	2005/04/22 12:04:08	164224
+++ cocoon/trunk/src/java/org/apache/cocoon/servlet/multipart/MultipartHttpServletRequest.java	2005/04/22 12:11:58	164225
@@ -15,43 +15,32 @@
  */
 package org.apache.cocoon.servlet.multipart;
 
-import java.io.BufferedReader;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
 import java.util.Enumeration;
 import java.util.Hashtable;
-import java.util.Locale;
-import java.util.Map;
 import java.util.Vector;
 
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpServletRequestWrapper;
 
 /**
  * Servlet request wrapper for multipart parser.
  *
  * @author <a href="mailto:j.tervoorde@home.nl">Jeroen ter Voorde</a>
  * @author Stefano Mazzocchi
- * @version CVS $Id: MultipartHttpServletRequest.java,v 1.7 2004/03/05 13:02:58 bdelacretaz Exp $
+ * @version CVS $Id$
  */
-public class MultipartHttpServletRequest implements HttpServletRequest {
-
-    /** The wrapped request */
-    private HttpServletRequest request = null;
+public class MultipartHttpServletRequest extends HttpServletRequestWrapper {
 
     /** The submitted parts */
-    private Hashtable values = null;
+    private Hashtable values;
 
     /**
      * Create this wrapper around the given request and including the given
      * parts.
      */
     public MultipartHttpServletRequest(HttpServletRequest request, Hashtable values) {
-        this.request = request;
+        super(request);
         this.values = values;
     }
 
@@ -86,12 +75,11 @@ public class MultipartHttpServletRequest
             if (result instanceof Vector) {
                 if (((Vector) result).size() == 1) {
                     return ((Vector) result).elementAt(0);
-                } else {
-                    return result;
                 }
+                return result;
             }
         } else {
-            String[] array = request.getParameterValues(name);
+            String[] array = this.getRequest().getParameterValues(name);
             Vector vec = new Vector();
 
             if (array != null) {
@@ -117,9 +105,8 @@ public class MultipartHttpServletRequest
     public Enumeration getParameterNames() {
         if (values != null) {
             return values.keys();
-        } else {
-            return request.getParameterNames();
         }
+        return this.getRequest().getParameterNames();
     }
 
     /**
@@ -161,417 +148,13 @@ public class MultipartHttpServletRequest
                     }
                     return results;
 
-                } else {
-                    return new String[]{value.toString()};
                 }
+                return new String[]{value.toString()};
             }
 
             return null;
-        } else {
-            return request.getParameterValues(name);
         }
+        return this.getRequest().getParameterValues(name);
     }
 
-    /**
-     * Method getAttribute
-     *
-     * @param name
-     *
-     */
-    public Object getAttribute(String name) {
-        return request.getAttribute(name);
-    }
-
-    /**
-     * Method getAttributeNames
-     *
-     */
-    public Enumeration getAttributeNames() {
-        return request.getAttributeNames();
-    }
-
-    /**
-     * Method getCharacterEncoding
-     *
-     */
-    public String getCharacterEncoding() {
-        return request.getCharacterEncoding();
-    }
-
-    /**
-     * Method getContentLength
-     *
-     */
-    public int getContentLength() {
-        return request.getContentLength();
-    }
-
-    /**
-     * Method getContentType
-     *
-     */
-    public String getContentType() {
-        return request.getContentType();
-    }
-
-    /**
-     * Method getInputStream
-     *
-     *
-     * @throws IOException
-     */
-    public ServletInputStream getInputStream() throws IOException {
-        return request.getInputStream();
-    }
-
-    /**
-     * Method getProtocol
-     *
-     */
-    public String getProtocol() {
-        return request.getProtocol();
-    }
-
-    /**
-     * Method getScheme
-     *
-     */
-    public String getScheme() {
-        return request.getScheme();
-    }
-
-    /**
-     * Method getServerName
-     *
-     */
-    public String getServerName() {
-        return request.getServerName();
-    }
-
-    /**
-     * Method getServerPort
-     *
-     */
-    public int getServerPort() {
-        return request.getServerPort();
-    }
-
-    /**
-     * Method getReader
-     *
-     *
-     * @throws IOException
-     */
-    public BufferedReader getReader() throws IOException {
-        return request.getReader();
-    }
-
-    /**
-     * Method getRemoteAddr
-     *
-     */
-    public String getRemoteAddr() {
-        return request.getRemoteAddr();
-    }
-
-    /**
-     * Method getRemoteHost
-     *
-     */
-    public String getRemoteHost() {
-        return request.getRemoteHost();
-    }
-
-    /**
-     * Method setAttribute
-     *
-     * @param name
-     * @param o
-     */
-    public void setAttribute(String name, Object o) {
-        request.setAttribute(name, o);
-    }
-
-    /**
-     * Method removeAttribute
-     *
-     * @param name
-     */
-    public void removeAttribute(String name) {
-        request.removeAttribute(name);
-    }
-
-    /**
-     * Method getLocale
-     *
-     */
-    public Locale getLocale() {
-        return request.getLocale();
-    }
-
-    /**
-     * Method getLocales
-     *
-     */
-    public Enumeration getLocales() {
-        return request.getLocales();
-    }
-
-    /**
-     * Method isSecure
-     *
-     */
-    public boolean isSecure() {
-        return request.isSecure();
-    }
-
-    /**
-     * Method getRequestDispatcher
-     *
-     * @param path
-     *
-     */
-    public RequestDispatcher getRequestDispatcher(String path) {
-        return request.getRequestDispatcher(path);
-    }
-
-    /**
-     * Method getRealPath
-     *
-     * @param path
-     *
-     */
-    public String getRealPath(String path) {
-        return request.getRealPath(path);
-    }
-
-    /**
-     * Method getAuthType
-     *
-     */
-    public String getAuthType() {
-        return request.getAuthType();
-    }
-
-    /**
-     * Method getCookies
-     *
-     */
-    public Cookie[] getCookies() {
-        return request.getCookies();
-    }
-
-    /**
-     * Method getDateHeader
-     *
-     * @param name
-     *
-     */
-    public long getDateHeader(String name) {
-        return request.getDateHeader(name);
-    }
-
-    /**
-     * Method getHeader
-     *
-     * @param name
-     *
-     */
-    public String getHeader(String name) {
-        return request.getHeader(name);
-    }
-
-    /**
-     * Method getHeaders
-     *
-     * @param name
-     *
-     */
-    public Enumeration getHeaders(String name) {
-        return request.getHeaders(name);
-    }
-
-    /**
-     * Method getHeaderNames
-     *
-     */
-    public Enumeration getHeaderNames() {
-        return request.getHeaderNames();
-    }
-
-    /**
-     * Method getIntHeader
-     *
-     * @param name
-     *
-     */
-    public int getIntHeader(String name) {
-        return request.getIntHeader(name);
-    }
-
-    /**
-     * Method getMethod
-     *
-     */
-    public String getMethod() {
-        return request.getMethod();
-    }
-
-    /**
-     * Method getPathInfo
-     *
-     */
-    public String getPathInfo() {
-        return request.getPathInfo();
-    }
-
-    /**
-     * Method getPathTranslated
-     *
-     */
-    public String getPathTranslated() {
-        return request.getPathTranslated();
-    }
-
-    /**
-     * Method getContextPath
-     *
-     */
-    public String getContextPath() {
-        return request.getContextPath();
-    }
-
-    /**
-     * Method getQueryString
-     *
-     */
-    public String getQueryString() {
-        return request.getQueryString();
-    }
-
-    /**
-     * Method getRemoteUser
-     *
-     */
-    public String getRemoteUser() {
-        return request.getRemoteUser();
-    }
-
-    /**
-     * Method isUserInRole
-     *
-     * @param role
-     *
-     */
-    public boolean isUserInRole(String role) {
-        return request.isUserInRole(role);
-    }
-
-    /**
-     * Method getUserPrincipal
-     *
-     */
-    public Principal getUserPrincipal() {
-        return request.getUserPrincipal();
-    }
-
-    /**
-     * Method getRequestedSessionId
-     *
-     */
-    public String getRequestedSessionId() {
-        return request.getRequestedSessionId();
-    }
-
-    /**
-     * Method getRequestURI
-     *
-     */
-    public String getRequestURI() {
-        return request.getRequestURI();
-    }
-
-    /**
-     * Method getServletPath
-     *
-     */
-    public String getServletPath() {
-        return request.getServletPath();
-    }
-
-    /**
-     * Method getSession
-     *
-     * @param create
-     *
-     */
-    public HttpSession getSession(boolean create) {
-        return request.getSession(create);
-    }
-
-    /**
-     * Method getSession
-     *
-     */
-    public HttpSession getSession() {
-        return request.getSession();
-    }
-
-    /**
-     * Method isRequestedSessionIdValid
-     *
-     */
-    public boolean isRequestedSessionIdValid() {
-        return request.isRequestedSessionIdValid();
-    }
-
-    /**
-     * Method isRequestedSessionIdFromCookie
-     *
-     */
-    public boolean isRequestedSessionIdFromCookie() {
-        return request.isRequestedSessionIdFromCookie();
-    }
-
-    /**
-     * Method isRequestedSessionIdFromURL
-     *
-     */
-    public boolean isRequestedSessionIdFromURL() {
-        return request.isRequestedSessionIdFromURL();
-    }
-
-    /**
-     * Method isRequestedSessionIdFromUrl
-     * @deprecated use {@link #isRequestedSessionIdFromURL()} instead
-     */
-    public boolean isRequestedSessionIdFromUrl() {
-        return request.isRequestedSessionIdFromURL();
-    }
-
-	/* (non-Javadoc)
-	 * @see javax.servlet.http.HttpServletRequest#getRequestURL()
-	 */
-	public StringBuffer getRequestURL() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.servlet.ServletRequest#getParameterMap()
-	 */
-	public Map getParameterMap() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.servlet.ServletRequest#setCharacterEncoding(java.lang.String)
-	 */
-	public void setCharacterEncoding(String arg0)
-		throws UnsupportedEncodingException {
-		// TODO Auto-generated method stub
-
-	}
-
 }

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26