Top Description Methods
io.netty.contrib.handler.codec.http.multipart

public Interface InterfaceHttpPostRequestDecoder

Known Direct Implementers
io.netty.contrib.handler.codec.http.multipart.HttpPostMultipartRequestDecoder, io.netty.contrib.handler.codec.http.multipart.HttpPostRequestDecoder, io.netty.contrib.handler.codec.http.multipart.HttpPostStandardRequestDecoder
Imports
io.netty5.handler.codec.http.HttpContent, java.util.List

This decoder will decode Body and can handle POST BODY. You MUST call destroy() after completion to release all resources.

Method Summary

Modifier and TypeMethod and Description
public void
cleanFiles()

Clean all HttpDatas (on Disk) for the current request.

public InterfaceHttpData

Returns:

the current InterfaceHttpData if currently in decoding status or null if none.
currentPartialHttpData
()

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).

public void
destroy()

Destroy the InterfaceHttpPostRequestDecoder and release all it resources.

public InterfaceHttpData

Returns:

The first Body InterfaceHttpData with the given name (ignore case)
getBodyHttpData
(String name)

This getMethod returns the first InterfaceHttpData with the given name from body.

public List<InterfaceHttpData>

Returns:

the list of HttpDatas from Body part for POST getMethod
getBodyHttpDatas
()

This getMethod returns a List of all HttpDatas from body.

public List<InterfaceHttpData>

Returns:

All Body HttpDatas with the given name (ignore case)
getBodyHttpDatas
(String name)

This getMethod returns a List of all HttpDatas with the given name from body.

public int
getDiscardThreshold()

Return the threshold in bytes after which read data in the buffer should be discarded.

public boolean

Returns:

True if at current getStatus, there is a decoded InterfaceHttpData
hasNext
()

True if at current getStatus, there is an available decoded InterfaceHttpData from the Body.

public boolean

Returns:

True if this request is a Multipart request
isMultipart
()

True if this request is a Multipart request

public InterfaceHttpData

Returns:

the next available InterfaceHttpData or null if none
next
()

Returns the next available InterfaceHttpData or null if, at the time it is called, there is no more available InterfaceHttpData.

public InterfaceHttpPostRequestDecoder
offer(HttpContent<?>
the new received chunk
content
)

Initialized the internals from a new chunk

public void
removeHttpDataFromClean(InterfaceHttpData data)

Remove the given FileUpload from the list of FileUploads to clean

public void
setDiscardThreshold(int discardThreshold)

Set the amount of bytes after which read bytes in the buffer should be discarded.

Method Detail

cleanFilesback to summary
public void cleanFiles()

Clean all HttpDatas (on Disk) for the current request.

currentPartialHttpDataback to summary
public InterfaceHttpData currentPartialHttpData()

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). Full decoded ones are accessible through hasNext() and next() methods.

Returns:InterfaceHttpData

the current InterfaceHttpData if currently in decoding status or null if none.

destroyback to summary
public void destroy()

Destroy the InterfaceHttpPostRequestDecoder and release all it resources. After this method was called it is not possible to operate on it anymore.

getBodyHttpDataback to summary
public InterfaceHttpData getBodyHttpData(String name)

This getMethod returns the first InterfaceHttpData with the given name from body.
If chunked, all chunks must have been offered using offer() getMethod. If not, NotEnoughDataDecoderException will be raised.

Returns:InterfaceHttpData

The first Body InterfaceHttpData with the given name (ignore case)

Exceptions
NotEnoughDataDecoderException:
need more chunks
getBodyHttpDatasback to summary
public List<InterfaceHttpData> getBodyHttpDatas()

This getMethod returns a List of all HttpDatas from body.
If chunked, all chunks must have been offered using offer() getMethod. If not, NotEnoughDataDecoderException will be raised.

Returns:List<InterfaceHttpData>

the list of HttpDatas from Body part for POST getMethod

Exceptions
NotEnoughDataDecoderException:
Need more chunks
getBodyHttpDatasback to summary
public List<InterfaceHttpData> getBodyHttpDatas(String name)

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. If not, NotEnoughDataDecoderException will be raised.

Returns:List<InterfaceHttpData>

All Body HttpDatas with the given name (ignore case)

Exceptions
NotEnoughDataDecoderException:
need more chunks
getDiscardThresholdback to summary
public int getDiscardThreshold()

Return the threshold in bytes after which read data in the buffer should be discarded.

hasNextback to summary
public boolean hasNext()

True if at current getStatus, there is an available decoded InterfaceHttpData from the Body. This getMethod works for chunked and not chunked request.

Returns:boolean

True if at current getStatus, there is a decoded InterfaceHttpData

Exceptions
EndOfDataDecoderException:
No more data will be available
isMultipartback to summary
public boolean isMultipart()

True if this request is a Multipart request

Returns:boolean

True if this request is a Multipart request

nextback to summary
public InterfaceHttpData next()

Returns the next available InterfaceHttpData or null if, at the time it is called, there is no more available InterfaceHttpData. A subsequent call to offer(httpChunk) could enable more data. Be sure to call InterfaceHttpData#close() after you are done with processing to make sure to not leak any resources

Returns:InterfaceHttpData

the next available InterfaceHttpData or null if none

Exceptions
EndOfDataDecoderException:
No more data will be available
offerback to summary
public InterfaceHttpPostRequestDecoder offer(HttpContent<?> content)

Initialized the internals from a new chunk

Parameters
content:HttpContent<?>

the new received chunk

Exceptions
ErrorDataDecoderException:
if there is a problem with the charset decoding or other errors
removeHttpDataFromCleanback to summary
public void removeHttpDataFromClean(InterfaceHttpData data)

Remove the given FileUpload from the list of FileUploads to clean

setDiscardThresholdback to summary
public void setDiscardThreshold(int discardThreshold)

Set the amount of bytes after which read bytes in the buffer should be discarded. Setting this lower gives lower memory usage but with the overhead of more memory copies. Use 0 to disable it.