Jwma

dtw.webmail.util
Class MultipartRequest

java.lang.Object
  |
  +--dtw.webmail.util.MultipartRequest

public class MultipartRequest
extends java.lang.Object

Class that encapsulates a MultipartRequest, internally * handling it. *

* The protocol to access the parameters resembles the one * of the ServletRequest class. * * @author Dieter Wimberger * @version 0.9.7 07/02/2003


Constructor Summary
MultipartRequest(javax.servlet.ServletRequest request)
          Constructs a MultipartRequest instance, with an upload limit of 2048 kB.
MultipartRequest(javax.servlet.ServletRequest request, int limit)
          Constructs a MultipartRequest instance.
 
Method Summary
 javax.mail.internet.MimeMultipart getAttachments()
          Returns the attachments as MimeMultipart.
 java.lang.String getParameter(java.lang.String name)
          Returns the value of a given parameter as String, or null if * the control was not successful or non existant.
 java.util.Enumeration getParameterNames()
          Returns the names of all the parameters as an Enumeration of * strings.
* It returns an empty Enumeration if there are no parameters.
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns all values of a given parameter as an array of strings.
 boolean hasAttachments()
          Tests if this MultipartRequest has attachments.
 void processRequest()
          Parses the incoming multipart/form-data by reading it from the * given request's input stream.
 
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.ServletRequest request)
                 throws java.io.IOException
Constructs a MultipartRequest instance, with an upload limit of 2048 kB.


MultipartRequest

public MultipartRequest(javax.servlet.ServletRequest request,
                        int limit)
                 throws java.io.IOException
Constructs a MultipartRequest instance. * * @return the newly constructed MultipartRequest instance.

Method Detail

getParameterNames

public java.util.Enumeration getParameterNames()
Returns the names of all the parameters as an Enumeration of * strings.
* It returns an empty Enumeration if there are no parameters. * * @return Enumeration of the names of all the parameters as strings.


getParameter

public java.lang.String getParameter(java.lang.String name)
Returns the value of a given parameter as String, or null if * the control was not successful or non existant. * Note:
* Mimics servlet request, do not call for multi value * parameters.
* * @param name of the parameter to be retrieved as String. * * @return the parameter's value as String.


getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Returns all values of a given parameter as an array of strings. * * If this MultipartRequest does not contain any values for this * parameter name, then this method returns null. * Otherwise the array contains one String for each value * of this parameter. * * @param name of the parameter to be retrieved as String. * * @return an array of strings,each representing a value of the * parameter.


hasAttachments

public boolean hasAttachments()
Tests if this MultipartRequest has attachments. * * @return true if it has attachments, false otherwise.


getAttachments

public javax.mail.internet.MimeMultipart getAttachments()
Returns the attachments as MimeMultipart. * * @return the attachments contained within in a MimeMultipart * instance.


processRequest

public void processRequest()
                    throws java.io.IOException
Parses the incoming multipart/form-data by reading it from the * given request's input stream. * * Note:Does not handle multiparts contained in multiparts. * * @throws IOException if uploaded content larger than allowed * or parsing failed.

java.io.IOException

Jwma

Copyright © 2000-2003 jwma team (All Rights Reserved.)