Class HttpPostRequestDecoder

java.lang.Object
io.netty.handler.codec.http.multipart.HttpPostRequestDecoder
All Implemented Interfaces:
InterfaceHttpPostRequestDecoder

public class HttpPostRequestDecoder extends Object implements InterfaceHttpPostRequestDecoder
This decoder will decode Body and can handle POST BODY. You MUST call destroy() after completion to release all resources.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Exception when the body is fully decoded, even if there is still data
    static class 
    Exception when an error occurs while decoding
    protected static enum 
    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 
    Exception when try reading data from request in chunked format, and not enough data are available (need more chunks)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clean all HttpDatas (on Disk) for the current request.
    Returns the current InterfaceHttpData if currently in decoding status, meaning all data are not yet within, or null if there is no InterfaceHttpData currently in decoding status (either because none yet decoded or none currently partially decoded).
    void
    Destroy the InterfaceHttpPostRequestDecoder and release all it resources.
    This getMethod returns the first InterfaceHttpData with the given name from body.
    If chunked, all chunks must have been offered using offer() getMethod.
    This getMethod returns a List of all HttpDatas from body.
    If chunked, all chunks must have been offered using offer() getMethod.
    This getMethod returns a List of all HttpDatas with the given name from body.
    If chunked, all chunks must have been offered using offer() getMethod.
    int
    Return the threshold in bytes after which read data in the buffer should be discarded.
    protected static String[]
    Check from the request ContentType if this request is a Multipart request.
    boolean
    True if at current getStatus, there is an available decoded InterfaceHttpData from the Body.
    boolean
    True if this request is a Multipart request
    static boolean
    Check if the given request is a multipart request
    Returns the next available InterfaceHttpData or null if, at the time it is called, there is no more available InterfaceHttpData.
    offer(HttpContent content)
    Initialized the internals from a new chunk
    void
    Remove the given FileUpload from the list of FileUploads to clean
    void
    setDiscardThreshold(int discardThreshold)
    Set the amount of bytes after which read bytes in the buffer should be discarded.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait