Package net.i2p.servlet
Class RequestWrapper
java.lang.Object
net.i2p.servlet.RequestWrapper
public class RequestWrapper extends Object
Refactored in 0.9.33 to use Servlet 3.0 API and remove dependency
on old Jetty 5 MultiPartRequest code. See ticket 2109.
Previous history:
Required major changes for Jetty 6
to support change from MultiPartRequest to MultiPartFilter.
See http://docs.codehaus.org/display/JETTY/File+Upload+in+jetty6
Unfortunately, Content-type not available until Jetty 8
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=349110
So we could either extend and fix MultiPartFilter, and rewrite everything here,
or copy MultiPartRequest into our war and fix it so it compiles with Jetty 6.
We do the latter.
The filter would have been added in web.xml,
see that file, where it's commented out.
Filter isn't supported until Tomcat 7 (Servlet 3.0)
- Since:
- 0.9.19 moved from susimail so it may be used by routerconsole too
- Author:
- user
-
Constructor Summary
Constructors Constructor Description RequestWrapper(HttpServletRequest httpRequest)
-
Method Summary
Modifier and Type Method Description Object
getAttribute(String string)
int
getContentLength()
String
getContentType()
String
getContentType(String partName)
String
getFilename(String partName)
InputStream
getInputStream(String partName)
String
getParameter(String name)
String
getParameter(String name, String defaultValue)
Enumeration<String>
getParameterNames()
HttpSession
getSession()
HttpSession
getSession(boolean b)
-
Constructor Details
-
RequestWrapper
- Parameters:
httpRequest
-
-
-
Method Details
-
getSession
- Parameters:
b
-
-
getParameter
- Parameters:
name
- Specific parameter key- Returns:
- parameter value
-
getSession
-
getParameterNames
- Returns:
- List of request parameter names
- Throws:
IllegalStateException
- if the request is too large
-
getContentLength
public int getContentLength()- Returns:
- The total length of the content.
-
getContentType
- Returns:
- The content type of the request.
-
getContentType
- Throws:
IllegalStateException
- if the request is too large
-
getAttribute
-
getParameter
- Throws:
IllegalStateException
- if the request is too large
-
getFilename
- Throws:
IllegalStateException
- if the request is too large
-
getInputStream
- Throws:
IllegalStateException
- if the request is too large
-