public class HttpPostRequestDecoder extends Object implements io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoder
destroy() after completion to release all resources.| 限定符和类型 | 类和说明 |
|---|---|
static class |
HttpPostRequestDecoder.EndOfDataDecoderException
Exception when the body is fully decoded, even if there is still data
|
static class |
HttpPostRequestDecoder.ErrorDataDecoderException
Exception when an error occurs while decoding
|
protected static class |
HttpPostRequestDecoder.MultiPartStatus
states follow NOTSTARTED PREAMBLE ( (HEADERDELIMITER DISPOSITION (FIELD |
FILEUPLOAD))* (HEADERDELIMITER DISPOSITION MIXEDPREAMBLE (MIXEDDELIMITER
MIXEDDISPOSITION MIXEDFILEUPLOAD)+ MIXEDCLOSEDELIMITER)* CLOSEDELIMITER)+
EPILOGUE
First getStatus is: NOSTARTED
Content-type: multipart/form-data, boundary=AaB03x => PREAMBLE in Header
--AaB03x => HEADERDELIMITER content-disposition: form-data; name="field1"
=> DISPOSITION
Joe Blow => FIELD --AaB03x => HEADERDELIMITER content-disposition:
form-data; name="pics" => DISPOSITION Content-type: multipart/mixed,
boundary=BbC04y
--BbC04y => MIXEDDELIMITER Content-disposition: attachment;
filename="file1.txt" => MIXEDDISPOSITION Content-Type: text/plain
... contents of file1.txt ... => MIXEDFILEUPLOAD --BbC04y =>
MIXEDDELIMITER Content-disposition: file; filename="file2.gif" =>
MIXEDDISPOSITION Content-type: image/gif Content-Transfer-Encoding:
binary
...contents of file2.gif... => MIXEDFILEUPLOAD --BbC04y-- =>
MIXEDCLOSEDELIMITER --AaB03x-- => CLOSEDELIMITER
Once CLOSEDELIMITER is found, last getStatus is EPILOGUE
|
static class |
HttpPostRequestDecoder.NotEnoughDataDecoderException
Exception when try reading data from request in chunked format, and not
enough data are available (need more chunks)
|
| 构造器和说明 |
|---|
HttpPostRequestDecoder(io.netty.handler.codec.http.multipart.HttpDataFactory factory,
io.netty.handler.codec.http.HttpRequest request) |
HttpPostRequestDecoder(io.netty.handler.codec.http.multipart.HttpDataFactory factory,
io.netty.handler.codec.http.HttpRequest request,
Charset charset) |
HttpPostRequestDecoder(io.netty.handler.codec.http.HttpRequest request) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cleanFiles() |
io.netty.handler.codec.http.multipart.InterfaceHttpData |
currentPartialHttpData() |
void |
destroy() |
io.netty.handler.codec.http.multipart.InterfaceHttpData |
getBodyHttpData(String name) |
List<io.netty.handler.codec.http.multipart.InterfaceHttpData> |
getBodyHttpDatas() |
List<io.netty.handler.codec.http.multipart.InterfaceHttpData> |
getBodyHttpDatas(String name) |
int |
getDiscardThreshold() |
protected static String[] |
getMultipartDataBoundary(String contentType)
Check from the request ContentType if this request is a Multipart request.
|
boolean |
hasNext() |
boolean |
isMultipart() |
static boolean |
isMultipart(io.netty.handler.codec.http.HttpRequest request)
Check if the given request is a multipart request
|
io.netty.handler.codec.http.multipart.InterfaceHttpData |
next() |
io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoder |
offer(io.netty.handler.codec.http.HttpContent content) |
void |
removeHttpDataFromClean(io.netty.handler.codec.http.multipart.InterfaceHttpData data) |
void |
setDiscardThreshold(int discardThreshold) |
public HttpPostRequestDecoder(io.netty.handler.codec.http.HttpRequest request)
request - the request to decodeNullPointerException - for requestHttpPostRequestDecoder.ErrorDataDecoderException - if the default charset was wrong when decoding or other
errorspublic HttpPostRequestDecoder(io.netty.handler.codec.http.multipart.HttpDataFactory factory,
io.netty.handler.codec.http.HttpRequest request)
factory - the factory used to create InterfaceHttpDatarequest - the request to decodeNullPointerException - for request or factoryHttpPostRequestDecoder.ErrorDataDecoderException - if the default charset was wrong when decoding or other
errorspublic HttpPostRequestDecoder(io.netty.handler.codec.http.multipart.HttpDataFactory factory,
io.netty.handler.codec.http.HttpRequest request,
Charset charset)
factory - the factory used to create InterfaceHttpDatarequest - the request to decodecharset - the charset to use as defaultNullPointerException - for request or charset or factoryHttpPostRequestDecoder.ErrorDataDecoderException - if the default charset was wrong when decoding or other
errorspublic static boolean isMultipart(io.netty.handler.codec.http.HttpRequest request)
protected static String[] getMultipartDataBoundary(String contentType)
public boolean isMultipart()
isMultipart 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic void setDiscardThreshold(int discardThreshold)
setDiscardThreshold 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic int getDiscardThreshold()
getDiscardThreshold 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic List<io.netty.handler.codec.http.multipart.InterfaceHttpData> getBodyHttpDatas()
getBodyHttpDatas 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic List<io.netty.handler.codec.http.multipart.InterfaceHttpData> getBodyHttpDatas(String name)
getBodyHttpDatas 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic io.netty.handler.codec.http.multipart.InterfaceHttpData getBodyHttpData(String name)
getBodyHttpData 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoder offer(io.netty.handler.codec.http.HttpContent content)
offer 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic boolean hasNext()
hasNext 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic io.netty.handler.codec.http.multipart.InterfaceHttpData next()
next 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic io.netty.handler.codec.http.multipart.InterfaceHttpData currentPartialHttpData()
currentPartialHttpData 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic void destroy()
destroy 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic void cleanFiles()
cleanFiles 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderpublic void removeHttpDataFromClean(io.netty.handler.codec.http.multipart.InterfaceHttpData data)
removeHttpDataFromClean 在接口中 io.netty.handler.codec.http.multipart.InterfaceHttpPostRequestDecoderCopyright © 2019. All rights reserved.