|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.appserver.WOMultipartIterator
This class represents the content of a multipart/form-data HTTP request.
You get the iterator for such a request by calling multipartIterator
on the WORequest object.
Once you have this object, you get WOFormData objects by repeatedly calling nextFormData
,
until it returns null.
Each WOFormData allows you to introspect the sub-headers, as well as either look at the form
value(s) or grab the entire content of the part as an InputStream subclass.
The InputStream subclass is a WOFormDataInpuStream and can be used to stream large file
uploads to disk (or elsewhere).
The WOMultipartIterator should NOT be used with WOFileUpload component actions. It may be used
with component actions where there is no WOFileUpload, and it may be used in DirectActions.
Nested Class Summary | |
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. |
Constructor Summary | |
WOMultipartIterator(WORequest aRequest)
|
Method Summary | |
String |
boundary()
Returns the boundary from the content-type header of the WORequest. |
int |
contentLengthRemaining()
Returns the number of bytes left to be read from the request content stream. |
boolean |
didContentTerminatePrematurely()
Returns true if the underlying content stream terminated early. |
NSDictionary |
multipartHeaders()
Returns the parsed values from the content-type header of the WORequest. |
WOMultipartIterator.WOFormData |
nextFormData()
This is the primary method for the iterator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WOMultipartIterator(WORequest aRequest)
Method Detail |
public String boundary()
public int contentLengthRemaining()
public boolean didContentTerminatePrematurely()
public NSDictionary multipartHeaders()
public WOMultipartIterator.WOFormData nextFormData()
null
. Note that each time this method is invoked, it looks at the previously returned object.
If that object represents a file upload, by having the filename sub-header in its content-disposition
headers, it will have the file data set to null
. Thus, if you are using this method to upload files,
you must use up the file data as you get the WOFormData objects. If the previous object was a file upload,
even if you have a reference to the InputStream, it is summarily closed once nextFormData
is called again.
|
Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |