jbpm-form-modeler-request-dispatcher 6.0.0.CR4-Pre1

org.jbpm.formModeler.service.bb.mvc.controller
Class RequestMultipartWrapper

java.lang.Object
  extended by javax.servlet.ServletRequestWrapper
      extended by javax.servlet.http.HttpServletRequestWrapper
          extended by org.jbpm.formModeler.service.bb.mvc.controller.RequestMultipartWrapper
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class RequestMultipartWrapper
extends javax.servlet.http.HttpServletRequestWrapper

Request wrapper that handles multipart post and retrieves files and parameters


Field Summary
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
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
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.
 
Method Summary
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
 
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
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
 
Methods inherited from class javax.servlet.ServletRequestWrapper
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
 
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
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
 

Field Detail

requestFiles

protected Map<String,org.apache.commons.fileupload.FileItem> requestFiles
Map of parameters which are uploaded files *


requestParameters

protected Map<String,List<String>> requestParameters
Map of regular parameters and their values


uploadedFiles

protected Map<String,File> uploadedFiles
Map of uploaded files

Constructor Detail

RequestMultipartWrapper

public RequestMultipartWrapper(javax.servlet.http.HttpServletRequest request,
                               String saveDirectory,
                               int maxPostSize,
                               String encoding)
                        throws IOException
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.

Parameters:
request - the servlet request.
saveDirectory - the directory in which to save any uploaded files.
maxPostSize - the maximum size of the POST content.
Throws:
IOException - if the uploaded content is larger than maxPostSize or there's a problem reading or parsing the request.
Method Detail

addFormField

protected void addFormField(org.apache.commons.fileupload.FileItem item)
                     throws IOException
Adds a new regular field to the list of parameters

Parameters:
item -
Throws:
IOException

addUploadedFile

protected void addUploadedFile(org.apache.commons.fileupload.FileItem item)
                        throws Exception
Adds a file field to the list of parameters

Parameters:
item -
Throws:
Exception

getParameterNames

public Enumeration getParameterNames()
Returns the parameter names on the MultipartRequest

Specified by:
getParameterNames in interface javax.servlet.ServletRequest
Overrides:
getParameterNames in class javax.servlet.ServletRequestWrapper
Returns:
An Enumeration containing all the Parameter Names

getParameter

public String getParameter(String name)
Returns the value for the given parameter name

Specified by:
getParameter in interface javax.servlet.ServletRequest
Overrides:
getParameter in class javax.servlet.ServletRequestWrapper
Parameters:
name - the parameter name
Returns:
The value for the given parameter name

getParameterValues

public String[] getParameterValues(String name)
Returns the values for the given parameter name

Specified by:
getParameterValues in interface javax.servlet.ServletRequest
Overrides:
getParameterValues in class javax.servlet.ServletRequestWrapper
Parameters:
name - the parameter name
Returns:
The values for the given parameter name

getParameterMap

public Map getParameterMap()
Returns a Map containing all the parameters on the MultipartRequest

Specified by:
getParameterMap in interface javax.servlet.ServletRequest
Overrides:
getParameterMap in class javax.servlet.ServletRequestWrapper
Returns:
Map containing all the parameters on the MultipartRequest

getFileParameterNames

public Enumeration getFileParameterNames()
Returns the parameter names on the MultipartRequest that are of type file

Returns:
An Enumeration containing all the Parameter Names

getUploadedFile

public File getUploadedFile(String parameter)
Returns the uploaded file for a given parameter, or null it not found

Parameters:
parameter -
Returns:

jbpm-form-modeler-request-dispatcher 6.0.0.CR4-Pre1

Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.