@Internal public class FileTypeHandler extends Object implements NettyCustomizableResponseTypeHandler<Object>
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
FileTypeHandler(NettyHttpServerConfiguration.FileTypeHandlerConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
handle(Object obj,
HttpRequest<?> request,
MutableHttpResponse<?> response,
io.netty.channel.ChannelHandlerContext context)
Responsible for fully handling the response, including any closing of the channel.
|
protected void |
setDateAndCacheHeaders(MutableHttpResponse response,
long lastModified) |
protected void |
setDateHeader(MutableHttpResponse response) |
boolean |
supports(Class<?> type) |
public FileTypeHandler(NettyHttpServerConfiguration.FileTypeHandlerConfiguration configuration)
configuration
- The file type handler configurationpublic void handle(Object obj, HttpRequest<?> request, MutableHttpResponse<?> response, io.netty.channel.ChannelHandlerContext context)
NettyCustomizableResponseTypeHandler
handle
in interface NettyCustomizableResponseTypeHandler<Object>
obj
- The object to be handledrequest
- The native Netty requestresponse
- The mutable Micronaut responsecontext
- The channel contextpublic boolean supports(Class<?> type)
supports
in interface NettyCustomizableResponseTypeHandler<Object>
type
- The type to checkprotected void setDateAndCacheHeaders(MutableHttpResponse response, long lastModified)
response
- The Http responselastModified
- The last modifiedprotected void setDateHeader(MutableHttpResponse response)
response
- The Http response