All Packages Class Hierarchy This Package Previous Next Index
Class com.andthehorseyourodeinon.utils.PostedForm
java.lang.Object
|
+----com.andthehorseyourodeinon.utils.PostedForm
- public class PostedForm
- extends Object
PostedForm is a data storage class for non-servlet-based, multi-part
MIME-encoded document uploads.
An uploaded form is stored as a collection of headers (generally
generated by the browser), a collection of content parts, and
a collection of MIME-types (corresponsing to the content parts).
Content parts and their corresponding MIME-types are mapped by a
unique section name.
- Version:
- $Id: PostedForm.java,v 1.1 2000/05/16 22:45:10 samuelg Exp $
- See Also:
- HTTPUtils
-
PostedForm()
-
-
addContent(String, byte[])
- add a byte array as a named section, assuming a String (ISO-8859-1) MIME-type.
-
addContent(String, byte[], String)
- add a byte array as a named section, using the specified MIME-type.
-
addContentType(String, String)
- add a MIME-type to the collection of content-types for a named section
-
addHeader(String)
- add a String containing a name-value pair to the collection of headers
-
addHeader(String, String)
- add a name-value pair to the collection of headers
-
contents()
- Contents are stored as name-indexed sections.
-
getContent(String)
- Retrieve a named content section as an array of bytes.
-
getContentString(String)
- Retrieve a named content section as a String.
-
getContentType(String)
- Retrieve the type of a named content section.
-
getHeader(String)
- Retrieve a named browser header, e.g., "user_agent".
-
getHeaderString(String)
- Retrieve a named browser header, e.g., "user_agent".
-
hasContent(String)
- determine whether a named section has content
-
hasContentType(String)
- determine whether a named section has defined a MIME-type
-
hasHeader(String)
- determine whether a named header exists
-
headers()
- Headers are stored as name-value pairs.
PostedForm
public PostedForm()
headers
public Enumeration headers()
- Headers are stored as name-value pairs.
- Returns:
- an Enumeration of the names of headers
contents
public Enumeration contents()
- Contents are stored as name-indexed sections.
- Returns:
- an Enumeration of the content section names
getHeader
public String getHeader(String name)
- Retrieve a named browser header, e.g., "user_agent".
- Returns:
- the header value for a given header name
getHeaderString
public String getHeaderString(String name)
- Retrieve a named browser header, e.g., "user_agent".
Legacy wrapper method for getHeader.
- Returns:
- the header value for a given header name
getContentType
public String getContentType(String name)
- Retrieve the type of a named content section.
- Returns:
- the MIME-type for a given section name
getContent
public byte[] getContent(String name)
- Retrieve a named content section as an array of bytes.
- Returns:
- an array of bytes
getContentString
public String getContentString(String name)
- Retrieve a named content section as a String.
- Returns:
- a String
addHeader
public void addHeader(String name,
String value)
- add a name-value pair to the collection of headers
addHeader
public void addHeader(String unparsed)
- add a String containing a name-value pair to the collection of headers
- Parameters:
- unparsed - string of the form "name=value"
addContentType
public void addContentType(String name,
String value)
- add a MIME-type to the collection of content-types for a named section
addContent
public void addContent(String name,
byte value[])
- add a byte array as a named section, assuming a String (ISO-8859-1) MIME-type.
addContent
public void addContent(String name,
byte value[],
String theContentType)
- add a byte array as a named section, using the specified MIME-type.
hasHeader
public boolean hasHeader(String name)
- determine whether a named header exists
hasContent
public boolean hasContent(String name)
- determine whether a named section has content
hasContentType
public boolean hasContentType(String name)
- determine whether a named section has defined a MIME-type
All Packages Class Hierarchy This Package Previous Next Index