public class RequestMultipartWrapper
extends javax.servlet.http.HttpServletRequestWrapper
Modifier and Type | Field and Description |
---|---|
protected Map<String,org.apache.commons.fileupload.FileItem> |
requestFiles
Map of parameters which are uploaded files *
|
protected Map<String,List<String>> |
requestParameters
Map of regular parameters and their values
|
protected Map<String,File> |
uploadedFiles
Map of uploaded files
|
Constructor and Description |
---|
RequestMultipartWrapper(javax.servlet.http.HttpServletRequest request,
String saveDirectory,
int maxPostSize,
String encoding)
Constructs a new MultipartRequest to handle the specified request,
saving any uploaded files to the given directory, and limiting the
upload size to the specified length.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addFormField(org.apache.commons.fileupload.FileItem item)
Adds a new regular field to the list of parameters
|
protected void |
addUploadedFile(org.apache.commons.fileupload.FileItem item)
Adds a file field to the list of parameters
|
Enumeration |
getFileParameterNames()
Returns the parameter names on the MultipartRequest that are of type file
|
String |
getParameter(String name)
Returns the value for the given parameter name
|
Map |
getParameterMap()
Returns a Map containing all the parameters on the MultipartRequest
|
Enumeration |
getParameterNames()
Returns the parameter names on the MultipartRequest
|
String[] |
getParameterValues(String name)
Returns the values for the given parameter name
|
File |
getUploadedFile(String parameter)
Returns the uploaded file for a given parameter, or null it not found
|
authenticate, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
protected Map<String,org.apache.commons.fileupload.FileItem> requestFiles
protected Map<String,List<String>> requestParameters
public RequestMultipartWrapper(javax.servlet.http.HttpServletRequest request, String saveDirectory, int maxPostSize, String encoding) throws IOException
request
- the servlet request.saveDirectory
- the directory in which to save any uploaded files.maxPostSize
- the maximum size of the POST content.IOException
- if the uploaded content is larger than
maxPostSize or there's a problem reading or parsing the request.protected void addFormField(org.apache.commons.fileupload.FileItem item) throws IOException
item
- IOException
protected void addUploadedFile(org.apache.commons.fileupload.FileItem item) throws Exception
item
- Exception
public Enumeration getParameterNames()
getParameterNames
in interface javax.servlet.ServletRequest
getParameterNames
in class javax.servlet.ServletRequestWrapper
public String getParameter(String name)
getParameter
in interface javax.servlet.ServletRequest
getParameter
in class javax.servlet.ServletRequestWrapper
name
- the parameter namepublic String[] getParameterValues(String name)
getParameterValues
in interface javax.servlet.ServletRequest
getParameterValues
in class javax.servlet.ServletRequestWrapper
name
- the parameter namepublic Map getParameterMap()
getParameterMap
in interface javax.servlet.ServletRequest
getParameterMap
in class javax.servlet.ServletRequestWrapper
public Enumeration getFileParameterNames()
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.