agonism.dovetail.site.http
Class MultipartFormData

java.lang.Object
  |
  +--agonism.dovetail.site.http.MultipartFormData
All Implemented Interfaces:
IFormData

public class MultipartFormData
extends java.lang.Object
implements IFormData


Constructor Summary
MultipartFormData(javax.servlet.http.HttpServletRequest request)
          Constructs a new MultipartRequest to handle the specified request, and limiting the upload size to 1 Megabyte.
 
Method Summary
 byte[] getFile(java.lang.String name)
          Returns a byte[] object for the specified file, or null if the file was not included in the upload.
 java.lang.String getParameter(java.lang.String name)
          Returns the value of the named parameter as a String, or null if the parameter was not given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipartFormData

public MultipartFormData(javax.servlet.http.HttpServletRequest request)
                  throws java.io.IOException
Constructs a new MultipartRequest to handle the specified request, and limiting the upload size to 1 Megabyte. If the content is too large, an IOException is thrown. This constructor actually parses the multipart/form-data and throws an IOException if there's any problem reading or parsing the request.
Parameters:
request - the servlet request
Throws:
java.io.IOException - if the uploaded content is larger than 1 Megabyte or there's a problem reading or parsing the request
Method Detail

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns the value of the named parameter as a String, or null if the parameter was not given. The value is guaranteed to be in its normal, decoded form. If the parameter has multiple values, only the last one is returned.
Specified by:
getParameter in interface IFormData
Parameters:
name - the parameter name
Returns:
the parameter value

getFile

public byte[] getFile(java.lang.String name)
Returns a byte[] object for the specified file, or null if the file was not included in the upload.
Specified by:
getFile in interface IFormData
Parameters:
name - the file name
Returns:
a byte[] for the named file