com.groiss.servlet
Class MultipartRequest

java.lang.Object
  extended by com.groiss.servlet.MultipartRequest
All Implemented Interfaces:
HttpServletRequest, ServletRequest

public abstract class MultipartRequest
extends Object
implements HttpServletRequest

A wrapper of HttpServletRequest with additional methods to handle files and adding and removing parameters. Note that the createInstnace method must be called before any method of the original SerlvetRequest is called.


Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Constructor Summary
MultipartRequest()
           
 
Method Summary
abstract  void addParameter(String name, String value)
          Add a parameter to the parameter list.
static MultipartRequest createInstance(HttpServletRequest req)
          Crete the MultipartRequest from the ServletRequest.
abstract  Cookie getCookie(String id)
          Get cookie from id (don't iterate the array)
abstract  File getFile(String name)
          Return the locally stored temporary file associated with the parameter name given as argument.
abstract  Enumeration getFileNames()
          Return the name of the parameters containing files as values.
abstract  Hashtable getFiles()
          Deprecated.  
abstract  String getParamsAsLink()
          This method builds a parameter string suitable for a GET request out of the parameter map.
abstract  String getRemoteFileName(String name)
          Return the remote file name of the file associated with the parameter name given as argument.
abstract  void removeParameter(String name)
          Removes a parameter from the parameter list.
abstract  void setPathInfo(String path)
          Sets the path info.
abstract  void setQueryString(String params, boolean removeParams)
          Sets the paramters from a query-string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.http.HttpServletRequest
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Constructor Detail

MultipartRequest

public MultipartRequest()
Method Detail

createInstance

public static MultipartRequest createInstance(HttpServletRequest req)
Crete the MultipartRequest from the ServletRequest.

Parameters:
req - the original request

getFileNames

public abstract Enumeration getFileNames()
Return the name of the parameters containing files as values.


getFile

public abstract File getFile(String name)
Return the locally stored temporary file associated with the parameter name given as argument.

Parameters:
name - the name of the parameter

getRemoteFileName

public abstract String getRemoteFileName(String name)
Return the remote file name of the file associated with the parameter name given as argument.

Parameters:
name - the name of the parameter

addParameter

public abstract void addParameter(String name,
                                  String value)
Add a parameter to the parameter list. If the parameter is already in the list the

Parameters:
name - the name of the parameter
value - the value of the parameter

removeParameter

public abstract void removeParameter(String name)
Removes a parameter from the parameter list.

Parameters:
name - the name of the parameter

setPathInfo

public abstract void setPathInfo(String path)
Sets the path info.

Parameters:
path - the new path info

setQueryString

public abstract void setQueryString(String params,
                                    boolean removeParams)
Sets the paramters from a query-string.

Parameters:
params - the params in HTTP-GET syntax: param1=value1¶m2=value2
removeParams - if true for each parameter of the query string already existing values are removed.

getCookie

public abstract Cookie getCookie(String id)
Get cookie from id (don't iterate the array)


getParamsAsLink

public abstract String getParamsAsLink()
                                throws UnsupportedEncodingException
This method builds a parameter string suitable for a GET request out of the parameter map.

Returns:
a String of the form param1=value1&param2=value2
Throws:
UnsupportedEncodingException

getFiles

@Deprecated
public abstract Hashtable getFiles()
Deprecated. 



@enterprise 8.0.10809 Copyright © 2001-2012 Groiss Informatics GmbH. All Rights Reserved.