|
WebObjects 5.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.webobjects.appserver.WOMultipartIterator.WOFormData
This class represents a form data element from a multipart/form data document as defined in
http://www.ietf.org/rfc/rfc2388.txt.
Objects of this class are instantiated by WORequest's WOMultipartIterator, and
returned by the iterator's nextFormData method.
A form data is made up of headers and a content. The content can be accessed as an NSData,
a dictionary of form values, or as an InputStream. For large uploads, use the InputStream method,
as both other methods will read all the form data into memory.
Constructor Summary | |
protected |
WOMultipartIterator.WOFormData()
|
Method Summary | |
NSDictionary |
contentDispositionHeaders()
Returns the sub-headers dictionary for the content-disposition header. |
NSTimestamp |
dateFormValue(NSTimestampFormatter dateFormatter)
Method to return an NSTimestamp for the form value. |
NSData |
formData()
Equivalent to formData(4096) |
NSData |
formData(int bufferSize)
Returns the form element data as an NSData. |
InputStream |
formDataInputStream()
Returns the form element data as an InputStream. |
String |
formValue()
Returns the contents of this form-data element as a properly encoded String. |
NSDictionary |
headers()
Returns the headers dictionary for this form data. |
boolean |
isFileUpload()
Returns true if this object represents a file upload. |
boolean |
isStreamAvailable()
Returns true if formDataInputStream can be called. |
boolean |
isStreamValid()
Returns true if the underlying stream is valid (has not been closed). |
String |
name()
Returns the name of this form element. |
Number |
numericFormValue(NSNumberFormatter numericFormatter)
Method to return a Number for the form value. |
String |
toString()
Returns a String representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected WOMultipartIterator.WOFormData()
Method Detail |
public NSDictionary contentDispositionHeaders()
formDataInputStream()
,
formData()
public NSTimestamp dateFormValue(NSTimestampFormatter dateFormatter) throws IOException
null
if it can't cast the form value into a valid
NSTimestamp.
NOTE: This method invokes formValue()dateFormatter
- the formatter used to coerce the form value to a date value.formValue()
,
#numericFormValueForKey( String aKey, NSNumberFormatter numericFormatter )
public NSData formData() throws IOException
public NSData formData(int bufferSize) throws IOException
bufferSize
as the size of the transfer buffer.
This method returns null
if formDataInputStream
has been called earlier on the object.bufferSize
- the size in bytes of the buffer to use to read in the underlying data from the streamformDataInputStream()
public InputStream formDataInputStream()
formData
has been called earlier on the object.formData()
public String formValue() throws IOException
formData
formData()
public NSDictionary headers()
contentDispositionHeader
method.formDataInputStream()
,
formData()
public boolean isFileUpload()
true
if this object represents a file upload. The determination is made by seeing if there is
a "filename" sub-header in the content-disposition header of the form element.true
if this is a file uploadpublic boolean isStreamAvailable()
true
if formDataInputStream
can be called.true
if formDataInputStream
can be called.formDataInputStream()
,
formData()
public boolean isStreamValid()
public String name()
public Number numericFormValue(NSNumberFormatter numericFormatter) throws IOException
null
if it can't cast the form value into a Number.
NOTE: This method invokes formValue()numericFormatter
- the formatter used to coerce the form value to a numeric value.formValue()
,
#dateFormValueForKey( String aKey , NSTimestampFormatter dateFormatter )
public String toString()
toString
in class Object
|
Last updated Fri Feb 21 13:15:00 PST 2003. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |