com.compoze.util
Class MultiPartFormData
java.lang.Object
|
+--com.compoze.util.MultiPartFormData
- All Implemented Interfaces:
- java.io.Serializable
- public class MultiPartFormData
- extends java.lang.Object
- implements java.io.Serializable
This class parses multi-part form data from a servlet and allows the
retrieval of each part.
- See Also:
Part
, Serialized Form
Field Summary |
static java.lang.String |
EXPECTED_CONTENT_TYPE
Expected content type for multipart form data. |
Constructor Summary |
MultiPartFormData(javax.servlet.ServletRequest request)
Constructor. |
Method Summary |
int |
getCount()
Get the total number of parts. |
Part |
getPart(int iIndex)
Return a part by its index (indices start at 0). |
Part |
getPart(java.lang.String sName)
Return a part by its name. |
java.util.Collection |
getParts(java.lang.String sName)
Return parts by its name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EXPECTED_CONTENT_TYPE
public static final java.lang.String EXPECTED_CONTENT_TYPE
- Expected content type for multipart form data.
MultiPartFormData
public MultiPartFormData(javax.servlet.ServletRequest request)
throws java.io.IOException
- Constructor. Reads all data from multi-part form into memory. The
ServletInputStream is closed after data is read.
- Parameters:
request
- the servlet request- Throws:
java.io.IOException
- if an i/o error occurred
getPart
public Part getPart(int iIndex)
- Return a part by its index (indices start at 0).
- Parameters:
iIndex
- the index of part to get- Returns:
- the part
- Throws:
IndexOutOfBoundsException
- if a part with the given index does not exist
getPart
public Part getPart(java.lang.String sName)
- Return a part by its name.
- Parameters:
sName
- the name of part to get- Returns:
- the part
- Throws:
IndexOutOfBoundsException
- if a part with the given index does not exist
getParts
public java.util.Collection getParts(java.lang.String sName)
- Return parts by its name.
- Parameters:
sName
- the name of part to get- Returns:
- the parts
- Throws:
IndexOutOfBoundsException
- if a part with the given index does not exist
getCount
public int getCount()
- Get the total number of parts.
- Returns:
- the total number of parts
Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.