|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectcn.dreampie.upload.multipart.MultipartParser
public class MultipartParser
A utility class to handle multipart/form-data requests,
the kind of requests that support file uploads. This class uses a
"pull" model where the reading of incoming files and params is
controlled by the client code, which allows incoming files to be stored
into any OutputStream. If you wish to use an API which
resembles HttpRequest, use the "push" model
MultipartRequest instead. It's an easy-to-use wrapper
around this class.
MultipartRequest| 构造方法摘要 | |
|---|---|
MultipartParser(HttpRequest req,
int maxSize)
Creates a MultipartParser from the specified request,
which limits the upload size to the specified length, buffers for
performance and prevent attempts to read past the amount specified
by the Content-Length. |
|
MultipartParser(HttpRequest req,
int maxSize,
boolean buffer,
boolean limitLength)
Creates a MultipartParser from the specified request,
which limits the upload size to the specified length, and optionally
buffers for performance and prevents attempts to read past the amount
specified by the Content-Length. |
|
MultipartParser(HttpRequest req,
int maxSize,
boolean buffer,
boolean limitLength,
String encoding)
Creates a MultipartParser from the specified request,
which limits the upload size to the specified length, and optionally
buffers for performance and prevents attempts to read past the amount
specified by the Content-Length, and with a specified encoding. |
|
| 方法摘要 | |
|---|---|
Part |
readNextPart()
Read the next part arriving in the stream. |
void |
setEncoding(String encoding)
Sets the encoding used to parse from here onward. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public MultipartParser(HttpRequest req,
int maxSize)
throws IOException
MultipartParser from the specified request,
which limits the upload size to the specified length, buffers for
performance and prevent attempts to read past the amount specified
by the Content-Length.
req - the servlet request.maxSize - the maximum size of the POST content.
IOException
public MultipartParser(HttpRequest req,
int maxSize,
boolean buffer,
boolean limitLength)
throws IOException
MultipartParser from the specified request,
which limits the upload size to the specified length, and optionally
buffers for performance and prevents attempts to read past the amount
specified by the Content-Length.
req - the servlet request.maxSize - the maximum size of the POST content.buffer - whether to do internal buffering or let the server buffer,
useful for servers that don't bufferlimitLength - boolean flag to indicate if we need to filter
the request's input stream to prevent trying to
read past the end of the stream.
IOException
public MultipartParser(HttpRequest req,
int maxSize,
boolean buffer,
boolean limitLength,
String encoding)
throws IOException
MultipartParser from the specified request,
which limits the upload size to the specified length, and optionally
buffers for performance and prevents attempts to read past the amount
specified by the Content-Length, and with a specified encoding.
req - the servlet request.maxSize - the maximum size of the POST content.buffer - whether to do internal buffering or let the server buffer,
useful for servers that don't bufferlimitLength - boolean flag to indicate if we need to filter
the request's input stream to prevent trying to
read past the end of the stream.encoding - the encoding to use for parsing, default is ISO-8859-1.
IOException| 方法详细信息 |
|---|
public void setEncoding(String encoding)
encoding - The encoding to use for parsing
public Part readNextPart()
throws IOException
FilePart or a ParamPart, or null
to indicate there are no more parts to read. The order of arrival
corresponds to the order of the form elements in the submitted form.
FilePart, a ParamPart or
null if there are no more parts to read.
IOException - if an input or output exception has occurred.FilePart,
ParamPart
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||