java.lang.Object
|
+--javax.servlet.ServletRequestWrapper
|
+--javax.servlet.http.HttpServletRequestWrapper
|
+--MultipartRequest
Extracts parameter values from "multipart; form-data" contained in incoming HTTP servlet requests. For further details concerning multipart requests see RFC 1867.
| Nested Class Summary | |
class |
MultipartRequest.Part
This class is parts of some multipart |
| Field Summary | |
protected String |
boundary
|
protected byte[] |
dataBytes
|
protected StringBuffer |
dataString
|
static String |
DOULE_DASH
|
static String |
EMPTY_LINE
|
static String |
EOLN
|
protected int |
maxSize
|
protected Vector |
names
|
protected Map |
part_names
|
protected Map |
parts
|
protected HttpServletRequest |
request
|
| Fields inherited from interface javax.servlet.http.HttpServletRequest |
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Constructor Summary | |
MultipartRequest(HttpServletRequest request)
A convenience constructor allowing size of multipart content of incoming request to be of maximum size. |
|
MultipartRequest(HttpServletRequest request,
int maxSize)
Creates new incoming multi part out of |
|
| Method Summary | |
StringBuffer |
getAllData()
Returns all not parsed data |
String |
getParameter(String name)
Implementation of getParameter method. |
Map |
getParameterMap()
Implementation of getParameterMap. |
Enumeration |
getParameterNames()
Implementation of getParameterNames method. |
String[] |
getParameterValues(String name)
Implementation of getParameterValues. |
MultipartRequest.Part |
getPart(String name)
Returns Part with some name. |
protected MultipartRequest.Part |
getPart(String name,
int start)
Getting MultipartRequest.Part with some name starts from
some index in global buffer of incomming data. |
MultipartRequest.Part[] |
getParts(String name)
Returns all Part[] with some name. |
| Methods inherited from class javax.servlet.ServletRequestWrapper |
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.ServletRequest |
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocale, getLocales, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding |
| Field Detail |
public static final String EOLN
public static final String EMPTY_LINE
public static final String DOULE_DASH
protected HttpServletRequest request
protected String boundary
protected StringBuffer dataString
protected byte[] dataBytes
protected int maxSize
protected Vector names
protected Map parts
protected Map part_names
| Constructor Detail |
public MultipartRequest(HttpServletRequest request)
throws ServletException,
IOException
request - HttpServletRequest containing multipart message
ServletException - is thrown if thrown by this(request, -1);
IOException
public MultipartRequest(HttpServletRequest request,
int maxSize)
throws ServletException,
IOException
request - HttpServletRequest containing multipart messagemaxSize - max. allowable size of multipart message. If smaller than 0 it is assumed to
be Integer.MAX_VALUE
ServletException - is thrown if either of the following occurs:
IOException| Method Detail |
public StringBuffer getAllData()
StringBuffer of all datapublic Enumeration getParameterNames()
getParameterNames method.
getParameterNames in interface ServletRequestgetParameterNames in class ServletRequestWrapperEnumeration valuepublic String getParameter(String name)
getParameter method.
getParameter in interface ServletRequestgetParameter in class ServletRequestWrappername - a String value
String valuepublic String[] getParameterValues(String name)
getParameterValues.
getParameterValues in interface ServletRequestgetParameterValues in class ServletRequestWrappername - a String value
String[] valuepublic Map getParameterMap()
getParameterMap.
getParameterMap in interface ServletRequestgetParameterMap in class ServletRequestWrapperpublic MultipartRequest.Part getPart(String name)
Part with some name.
name - a name of part
Part valuepublic MultipartRequest.Part[] getParts(String name)
Part[] with some name.
name - a String value
Part[] value
protected MultipartRequest.Part getPart(String name,
int start)
MultipartRequest.Part with some name starts from
some index in global buffer of incomming data.
name - a String valuestart - an int value
Part value