|
WebObjects 5.4.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webobjects.appserver.WOMultipartIterator.WOFormData
public class 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()
|
protected |
WOMultipartIterator.WOFormData(String filePath)
|
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()
protected WOMultipartIterator.WOFormData(String filePath)
Method Detail |
---|
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 NSDictionary headers()
contentDispositionHeader
method.
WOMultipartIterator.WOFormData.formDataInputStream()
,
WOMultipartIterator.WOFormData.formData()
public NSDictionary contentDispositionHeaders()
WOMultipartIterator.WOFormData.formDataInputStream()
,
WOMultipartIterator.WOFormData.formData()
public String name()
public InputStream formDataInputStream()
formData
has been called earlier on the object.
WOMultipartIterator.WOFormData.formData()
,
WOMultipartIterator.WOFormData.formData(int)
public NSData formData() throws IOException
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 stream
IOException
WOMultipartIterator.WOFormData.formDataInputStream()
public boolean isStreamAvailable()
true
if formDataInputStream
can be called.
true
if formDataInputStream
can be called.WOMultipartIterator.WOFormData.formDataInputStream()
,
WOMultipartIterator.WOFormData.formData()
,
WOMultipartIterator.WOFormData.formData(int)
public String formValue() throws IOException
formData
IOException
()
,
WOMultipartIterator.WOFormData.formData(int)
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.
IOException
WOMultipartIterator.WOFormData.formValue()
,
WORequest.dateFormValueForKey( String aKey , NSTimestampFormatter dateFormatter )
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.
IOException
WOMultipartIterator.WOFormData.formValue()
,
WORequest.numericFormValueForKey( String aKey, NSNumberFormatter numericFormatter )
public boolean isStreamValid()
public String toString()
toString
in class Object
|
Last updated June 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |