org.makumba.commons.attributes
Class MultipartHttpParameters

java.lang.Object
  extended by org.makumba.commons.attributes.HttpParameters
      extended by org.makumba.commons.attributes.MultipartHttpParameters

public class MultipartHttpParameters
extends HttpParameters

Parses the input stream of a http request as a multipart/form-data. Stores uploaded files as org.makumba.Text. Normal http parameters are stored as Text.toString (simple) or Vectors (multiple) data inside the request:

Version:
$Id: MultipartHttpParameters.java 1726 2007-10-02 09:11:59Z manuel_gay $
Author:
Cristian Bogdan, Andreas Pesenhofer, Rudolf Mayer

Field Summary
(package private) static org.apache.commons.fileupload.disk.DiskFileItemFactory factory
           
(package private)  Hashtable<String,Object> parameters
           
 
Fields inherited from class org.makumba.commons.attributes.HttpParameters
atStart, reloadedParameters, request
 
Constructor Summary
MultipartHttpParameters(HttpServletRequest req)
           
 
Method Summary
(package private)  void addParameter(String name, String value)
           
(package private) static Object compose(Object a1, Object a2)
          TODO this should not be here but in a util class Composes two objects, if both are vectors, unites them
(package private)  void computeAtStart()
           
 Object getParameter(String s)
          Composes what is read from the multipart with what is in the query string.
 boolean knownAtStart(String s)
           
 
Methods inherited from class org.makumba.commons.attributes.HttpParameters
getParametersStartingWith, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parameters

Hashtable<String,Object> parameters

factory

static org.apache.commons.fileupload.disk.DiskFileItemFactory factory
Constructor Detail

MultipartHttpParameters

public MultipartHttpParameters(HttpServletRequest req)
Method Detail

computeAtStart

void computeAtStart()
Overrides:
computeAtStart in class HttpParameters

knownAtStart

public boolean knownAtStart(String s)
Overrides:
knownAtStart in class HttpParameters

addParameter

void addParameter(String name,
                  String value)

getParameter

public Object getParameter(String s)
Composes what is read from the multipart with what is in the query string. The assumption is that the multipart cannot change during execution, while the query string may change due to e.g. forwards

Overrides:
getParameter in class HttpParameters
Parameters:
s - the query string
Returns:
An Object holding the parameters

compose

static Object compose(Object a1,
                      Object a2)
TODO this should not be here but in a util class Composes two objects, if both are vectors, unites them

Parameters:
a1 - the first object
a2 - the second object
Returns:
a composed object