|
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
public class 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 | |
---|---|
protected |
WOMultipartIterator()
|
|
WOMultipartIterator(WORequest aRequest)
Intentionally Undocumented |
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)
protected WOMultipartIterator()
Method Detail |
---|
public String boundary()
public NSDictionary multipartHeaders()
public boolean didContentTerminatePrematurely()
public int contentLengthRemaining()
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 June 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |