: Class MultiPartRequest

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.mortbay.HTTP
Class MultiPartRequest

    java.lang.Object
      |
      +--com.mortbay.HTTP.MultiPartRequest

public class MultiPartRequest
extends java.lang.Object

Multipart Form Data request

This class decodes the multipart/form-data stream sent by a HTML form that uses a file input item.

#### Usage

Each part of the form data is named from the HTML form and is available either via getString(name) or getInputStream(name). Furthermore the MIME parameters and filename can be requested for each part.

Version:
  %I% (%E% %U%)
Author:
  (greg)

Constructor Summary
`MultiPartRequest(javax.servlet.http.HttpServletRequest request)` Constructor.

Method Summary
`boolean` | `contains(java.lang.String name)` Check if a named part is present
`java.lang.String` | `getFilename(java.lang.String name)` Get any file name associated with a part.
`java.io.InputStream` | `getInputStream(java.lang.String name)` Get the data of a part as a stream
`java.util.Hashtable` | `getParams(java.lang.String name)` Get the MIME parameters associated with a part.
`java.lang.String` | `getString(java.lang.String name)` Get the data of a part as a string

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MultiPartRequest

    public MultiPartRequest(javax.servlet.http.HttpServletRequest request)
                     throws java.io.IOException

  Constructor.
  Parameters:
    `request` - The request containing a multipart/form-data request
  Throws:
    java.io.IOException - IOException

Method Detail

### contains

    public boolean contains(java.lang.String name)

  Check if a named part is present
  Parameters:
    `name` - The part
  Returns:
    true if it was included

### getString

    public java.lang.String getString(java.lang.String name)

  Get the data of a part as a string
  Parameters:
    `name` - The part name
  Returns:
    The part data

### getInputStream

    public java.io.InputStream getInputStream(java.lang.String name)

  Get the data of a part as a stream
  Parameters:
    `name` - The part name
  Returns:
    Stream providing the part data

### getParams

    public java.util.Hashtable getParams(java.lang.String name)

  Get the MIME parameters associated with a part.
  Parameters:
    `name` - The part name
  Returns:
    Hashtable of parameters

### getFilename

    public java.lang.String getFilename(java.lang.String name)

  Get any file name associated with a part.
  Parameters:
    `name` - The part name
  Returns:
    The filename

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD