|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.netty.handler.codec.http2.HttpPostRequestEncoder
public class HttpPostRequestEncoder
This encoder will help to encode Request for a FORM as POST.
Nested Class Summary | |
---|---|
static class |
HttpPostRequestEncoder.ErrorDataEncoderException
Exception when an error occurs while encoding |
Constructor Summary | |
---|---|
HttpPostRequestEncoder(HttpDataFactory factory,
HttpRequest request,
boolean multipart)
|
|
HttpPostRequestEncoder(HttpDataFactory factory,
HttpRequest request,
boolean multipart,
Charset charset)
|
|
HttpPostRequestEncoder(HttpRequest request,
boolean multipart)
|
Method Summary | |
---|---|
void |
addBodyAttribute(String name,
String value)
Add a simple attribute in the body as Name=Value |
void |
addBodyFileUpload(String name,
File file,
String contentType,
boolean isText)
Add a file as a FileUpload |
void |
addBodyFileUploads(String name,
File[] file,
String[] contentType,
boolean[] isText)
Add a series of Files associated with one File parameter (implied Mixed mode in Multipart) |
void |
addBodyHttpData(InterfaceHttpData data)
Add the InterfaceHttpData to the Body list |
void |
cleanFiles()
Clean all HttpDatas (on Disk) for the current request. |
void |
close()
|
HttpRequest |
finalizeRequest()
Finalize the request by preparing the Header in the request and returns the request ready to be sent. |
List<InterfaceHttpData> |
getBodyListAttributes()
This method returns a List of all InterfaceHttpData from body part. |
boolean |
hasNextChunk()
|
boolean |
isChunked()
|
boolean |
isEndOfInput()
|
boolean |
isMultipart()
True if this request is a Multipart request |
HttpChunk |
nextChunk()
Returns the next available HttpChunk. |
void |
setBodyHttpDatas(List<InterfaceHttpData> datas)
Set the Body HttpDatas list |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpPostRequestEncoder(HttpRequest request, boolean multipart) throws HttpPostRequestEncoder.ErrorDataEncoderException, NullPointerException
request
- the request to encodemultipart
- True if the FORM is a ENCTYPE="multipart/form-data"
NullPointerException
- for request
HttpPostRequestEncoder.ErrorDataEncoderException
- if the request is not a POSTpublic HttpPostRequestEncoder(HttpDataFactory factory, HttpRequest request, boolean multipart) throws HttpPostRequestEncoder.ErrorDataEncoderException, NullPointerException
factory
- the factory used to create InterfaceHttpDatarequest
- the request to encodemultipart
- True if the FORM is a ENCTYPE="multipart/form-data"
NullPointerException
- for request and factory
HttpPostRequestEncoder.ErrorDataEncoderException
- if the request is not a POSTpublic HttpPostRequestEncoder(HttpDataFactory factory, HttpRequest request, boolean multipart, Charset charset) throws HttpPostRequestEncoder.ErrorDataEncoderException, NullPointerException
factory
- the factory used to create InterfaceHttpDatarequest
- the request to encodemultipart
- True if the FORM is a ENCTYPE="multipart/form-data"charset
- the charset to use as default
NullPointerException
- for request or charset or factory
HttpPostRequestEncoder.ErrorDataEncoderException
- if the request is not a POSTMethod Detail |
---|
public void cleanFiles()
public boolean isMultipart()
public List<InterfaceHttpData> getBodyListAttributes()
public void setBodyHttpDatas(List<InterfaceHttpData> datas) throws NullPointerException, HttpPostRequestEncoder.ErrorDataEncoderException
datas
-
NullPointerException
- for datas
HttpPostRequestEncoder.ErrorDataEncoderException
- if the encoding is in error or if the finalize were already donepublic void addBodyAttribute(String name, String value) throws NullPointerException, HttpPostRequestEncoder.ErrorDataEncoderException
name
- name of the parametervalue
- the value of the parameter
NullPointerException
- for name
HttpPostRequestEncoder.ErrorDataEncoderException
- if the encoding is in error or if the finalize were already donepublic void addBodyFileUpload(String name, File file, String contentType, boolean isText) throws NullPointerException, HttpPostRequestEncoder.ErrorDataEncoderException
name
- the name of the parameterfile
- the file to be uploaded (if not Multipart mode, only the filename will be included)contentType
- the associated contentType for the FileisText
- True if this file should be transmitted in Text format (else binary)
NullPointerException
- for name and file
HttpPostRequestEncoder.ErrorDataEncoderException
- if the encoding is in error or if the finalize were already donepublic void addBodyFileUploads(String name, File[] file, String[] contentType, boolean[] isText) throws NullPointerException, HttpPostRequestEncoder.ErrorDataEncoderException
name
- the name of the parameterfile
- the array of filescontentType
- the array of content Types associated with each fileisText
- the array of isText attribute (False meaning binary mode) for each file
NullPointerException
- also throws if array have different sizes
HttpPostRequestEncoder.ErrorDataEncoderException
- if the encoding is in error or if the finalize were already donepublic void addBodyHttpData(InterfaceHttpData data) throws NullPointerException, HttpPostRequestEncoder.ErrorDataEncoderException
data
-
NullPointerException
- for data
HttpPostRequestEncoder.ErrorDataEncoderException
- if the encoding is in error or if the finalize were already donepublic HttpRequest finalizeRequest() throws HttpPostRequestEncoder.ErrorDataEncoderException
HttpPostRequestEncoder.ErrorDataEncoderException
- if the encoding is in error or if the finalize were already donepublic boolean isChunked()
public void close() throws Exception
close
in interface org.jboss.netty.handler.stream.ChunkedInput
Exception
public boolean hasNextChunk() throws Exception
hasNextChunk
in interface org.jboss.netty.handler.stream.ChunkedInput
Exception
public HttpChunk nextChunk() throws HttpPostRequestEncoder.ErrorDataEncoderException
nextChunk
in interface org.jboss.netty.handler.stream.ChunkedInput
HttpPostRequestEncoder.ErrorDataEncoderException
- if the encoding is in errorpublic boolean isEndOfInput() throws Exception
isEndOfInput
in interface org.jboss.netty.handler.stream.ChunkedInput
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |