The Spring Framework

org.springframework.web.portlet.multipart
Class DefaultMultipartActionRequest

java.lang.Object
  extended by org.springframework.web.portlet.util.PortletRequestWrapper
      extended by org.springframework.web.portlet.util.ActionRequestWrapper
          extended by org.springframework.web.portlet.multipart.DefaultMultipartActionRequest
All Implemented Interfaces:
ActionRequest, PortletRequest, MultipartActionRequest

public class DefaultMultipartActionRequest
extends ActionRequestWrapper
implements MultipartActionRequest

Default implementation of the MultipartActionRequest interface. Provides management of pre-generated parameter values.

Since:
2.0
Author:
Juergen Hoeller
See Also:
PortletMultipartResolver

Field Summary
 
Fields inherited from interface javax.portlet.PortletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH, USER_INFO
 
Constructor Summary
protected DefaultMultipartActionRequest(ActionRequest request)
          Wrap the given Portlet ActionRequest in a MultipartActionRequest.
  DefaultMultipartActionRequest(ActionRequest request, Map multipartFiles, Map multipartParameters)
          Wrap the given Portlet ActionRequest in a MultipartActionRequest.
 
Method Summary
 MultipartFile getFile(String name)
          Return the contents plus description of an uploaded file in this request, or null if it does not exist.
 Map getFileMap()
          Return a Map of the multipart files contained in this request.
 Iterator getFileNames()
          Return an Iterator of String objects containing the parameter names of the multipart files contained in this request.
protected  Map getMultipartFiles()
          Obtain the MultipartFile Map for retrieval, lazily initializing it if necessary.
protected  Map getMultipartParameters()
          Obtain the multipart parameter Map for retrieval, lazily initializing it if necessary.
 String getParameter(String name)
           
 Map getParameterMap()
           
 Enumeration getParameterNames()
           
 String[] getParameterValues(String name)
           
protected  void initializeMultipart()
          Lazily initialize the multipart request, if possible.
protected  void setMultipartFiles(Map multipartFiles)
          Set a Map with parameter names as keys and MultipartFile objects as values.
protected  void setMultipartParameters(Map multipartParameters)
          Set a Map with parameter names as keys and String array objects as values.
 
Methods inherited from class org.springframework.web.portlet.util.ActionRequestWrapper
getCharacterEncoding, getContentLength, getContentType, getPortletInputStream, getReader, setCharacterEncoding
 
Methods inherited from class org.springframework.web.portlet.util.PortletRequestWrapper
getAttribute, getAttributeNames, getAuthType, getContextPath, getLocale, getLocales, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getProperties, getProperty, getPropertyNames, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.portlet.ActionRequest
getCharacterEncoding, getContentLength, getContentType, getPortletInputStream, getReader, setCharacterEncoding
 
Methods inherited from interface javax.portlet.PortletRequest
getAttribute, getAttributeNames, getAuthType, getContextPath, getLocale, getLocales, getPortalContext, getPortletMode, getPortletSession, getPortletSession, getPreferences, getProperties, getProperty, getPropertyNames, getRemoteUser, getRequestedSessionId, getResponseContentType, getResponseContentTypes, getScheme, getServerName, getServerPort, getUserPrincipal, getWindowState, isPortletModeAllowed, isRequestedSessionIdValid, isSecure, isUserInRole, isWindowStateAllowed, removeAttribute, setAttribute
 

Constructor Detail

DefaultMultipartActionRequest

public DefaultMultipartActionRequest(ActionRequest request,
                                     Map multipartFiles,
                                     Map multipartParameters)
Wrap the given Portlet ActionRequest in a MultipartActionRequest.

Parameters:
request - the request to wrap
multipartFiles - a map of the multipart files
multipartParameters - a map of the parameters to expose, with Strings as keys and String arrays as values

DefaultMultipartActionRequest

protected DefaultMultipartActionRequest(ActionRequest request)
Wrap the given Portlet ActionRequest in a MultipartActionRequest.

Parameters:
request - the request to wrap
Method Detail

getFileNames

public Iterator getFileNames()
Description copied from interface: MultipartActionRequest
Return an Iterator of String objects containing the parameter names of the multipart files contained in this request. These are the field names of the form (like with normal parameters), not the original file names.

Specified by:
getFileNames in interface MultipartActionRequest
Returns:
the names of the files

getFile

public MultipartFile getFile(String name)
Description copied from interface: MultipartActionRequest
Return the contents plus description of an uploaded file in this request, or null if it does not exist.

Specified by:
getFile in interface MultipartActionRequest
Parameters:
name - a String specifying the parameter name of the multipart file
Returns:
the uploaded content in the form of a MultipartFile object

getFileMap

public Map getFileMap()
Description copied from interface: MultipartActionRequest
Return a Map of the multipart files contained in this request.

Specified by:
getFileMap in interface MultipartActionRequest
Returns:
a map containing the parameter names as keys, and the MultipartFile objects as values
See Also:
MultipartFile

getParameterNames

public Enumeration getParameterNames()
Specified by:
getParameterNames in interface PortletRequest
Overrides:
getParameterNames in class PortletRequestWrapper

getParameter

public String getParameter(String name)
Specified by:
getParameter in interface PortletRequest
Overrides:
getParameter in class PortletRequestWrapper

getParameterValues

public String[] getParameterValues(String name)
Specified by:
getParameterValues in interface PortletRequest
Overrides:
getParameterValues in class PortletRequestWrapper

getParameterMap

public Map getParameterMap()
Specified by:
getParameterMap in interface PortletRequest
Overrides:
getParameterMap in class PortletRequestWrapper

setMultipartFiles

protected final void setMultipartFiles(Map multipartFiles)
Set a Map with parameter names as keys and MultipartFile objects as values. To be invoked by subclasses on initialization.


getMultipartFiles

protected Map getMultipartFiles()
Obtain the MultipartFile Map for retrieval, lazily initializing it if necessary.

See Also:
initializeMultipart()

setMultipartParameters

protected final void setMultipartParameters(Map multipartParameters)
Set a Map with parameter names as keys and String array objects as values. To be invoked by subclasses on initialization.


getMultipartParameters

protected Map getMultipartParameters()
Obtain the multipart parameter Map for retrieval, lazily initializing it if necessary.

See Also:
initializeMultipart()

initializeMultipart

protected void initializeMultipart()
Lazily initialize the multipart request, if possible. Only called if not already eagerly initialized.


The Spring Framework

Copyright © 2002-2007 The Spring Framework.