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

Constructor Index

 o PostedForm()

Method Index

 o addContent(String, byte[])
add a byte array as a named section, assuming a String (ISO-8859-1) MIME-type.
 o addContent(String, byte[], String)
add a byte array as a named section, using the specified MIME-type.
 o addContentType(String, String)
add a MIME-type to the collection of content-types for a named section
 o addHeader(String)
add a String containing a name-value pair to the collection of headers
 o addHeader(String, String)
add a name-value pair to the collection of headers
 o contents()
Contents are stored as name-indexed sections.
 o getContent(String)
Retrieve a named content section as an array of bytes.
 o getContentString(String)
Retrieve a named content section as a String.
 o getContentType(String)
Retrieve the type of a named content section.
 o getHeader(String)
Retrieve a named browser header, e.g., "user_agent".
 o getHeaderString(String)
Retrieve a named browser header, e.g., "user_agent".
 o hasContent(String)
determine whether a named section has content
 o hasContentType(String)
determine whether a named section has defined a MIME-type
 o hasHeader(String)
determine whether a named header exists
 o headers()
Headers are stored as name-value pairs.

Constructors

 o PostedForm
 public PostedForm()

Methods

 o headers
 public Enumeration headers()
Headers are stored as name-value pairs.

Returns:
an Enumeration of the names of headers
 o contents
 public Enumeration contents()
Contents are stored as name-indexed sections.

Returns:
an Enumeration of the content section names
 o getHeader
 public String getHeader(String name)
Retrieve a named browser header, e.g., "user_agent".

Returns:
the header value for a given header name
 o 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
 o getContentType
 public String getContentType(String name)
Retrieve the type of a named content section.

Returns:
the MIME-type for a given section name
 o getContent
 public byte[] getContent(String name)
Retrieve a named content section as an array of bytes.

Returns:
an array of bytes
 o getContentString
 public String getContentString(String name)
Retrieve a named content section as a String.

Returns:
a String
 o addHeader
 public void addHeader(String name,
                       String value)
add a name-value pair to the collection of headers

 o 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"
 o addContentType
 public void addContentType(String name,
                            String value)
add a MIME-type to the collection of content-types for a named section

 o addContent
 public void addContent(String name,
                        byte value[])
add a byte array as a named section, assuming a String (ISO-8859-1) MIME-type.

 o addContent
 public void addContent(String name,
                        byte value[],
                        String theContentType)
add a byte array as a named section, using the specified MIME-type.

 o hasHeader
 public boolean hasHeader(String name)
determine whether a named header exists

 o hasContent
 public boolean hasContent(String name)
determine whether a named section has content

 o 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