org.makumba.commons.attributes
Class MultipartHttpParameters
java.lang.Object
org.makumba.commons.attributes.HttpParameters
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:
- 1st line: boundary + CR+LF
- headers & values + CR+LF (e.g. filename="file.doc" Content-Type: application/octec-stream)
- CR+LF (Konqueror 3.2.1 sends CR CR)
- content (related to the headers just read)
- CR+LF - boundary CR+LF - headers... and so forth ...
- and after the last boundary you will have '--' with CR+LF
- Version:
- $Id: MultipartHttpParameters.java 1726 2007-10-02 09:11:59Z manuel_gay $
- Author:
- Cristian Bogdan, Andreas Pesenhofer, Rudolf Mayer
parameters
Hashtable<String,Object> parameters
factory
static org.apache.commons.fileupload.disk.DiskFileItemFactory factory
MultipartHttpParameters
public MultipartHttpParameters(HttpServletRequest req)
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 objecta2
- the second object
- Returns:
- a composed object