public static class HTTPServer.MultipartIterator extends Object implements Iterator<HTTPServer.MultipartIterator.Part>
MultipartIterator iterates over the parts of a multipart/form-data request.
For example, to support file upload from a web browser:
HTTPServer.VirtualHost.addContext(java.lang.String, org.noear.solon.boot.jlhttp.HTTPServer.ContextHandler, java.lang.String...) method or the HTTPServer.Context annotation.
MultipartIterator from
the client Request.
HTTPServer.MultipartIterator.Parts, processing each named field as appropriate -
for the file input field, read the uploaded file using the body input stream.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
HTTPServer.MultipartIterator.Part
The
Part class encapsulates a single part of the multipart. |
| 限定符和类型 | 字段和说明 |
|---|---|
protected HTTPServer.MultipartInputStream |
in |
protected boolean |
next |
| 构造器和说明 |
|---|
MultipartIterator(HTTPServer.Request req)
Creates a new MultipartIterator from the given request.
|
protected final HTTPServer.MultipartInputStream in
protected boolean next
public MultipartIterator(HTTPServer.Request req) throws IOException
req - the multipart/form-data requestIOException - if an IO error occursIllegalArgumentException - if the given request's content type
is not multipart/form-data, or is missing the boundarypublic boolean hasNext()
hasNext 在接口中 Iterator<HTTPServer.MultipartIterator.Part>public HTTPServer.MultipartIterator.Part next()
next 在接口中 Iterator<HTTPServer.MultipartIterator.Part>public void remove()
remove 在接口中 Iterator<HTTPServer.MultipartIterator.Part>Copyright © 2021. All rights reserved.