@Singleton public class FileTypeHandler extends java.lang.Object implements NettyCustomizableResponseTypeHandler<java.lang.Object>
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
FileTypeHandler(FileTypeHandlerConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
handle(java.lang.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(java.lang.Class<?> type) |
public FileTypeHandler(FileTypeHandlerConfiguration configuration)
configuration
- The file type handler configurationpublic void handle(java.lang.Object obj, HttpRequest<?> request, MutableHttpResponse<?> response, io.netty.channel.ChannelHandlerContext context)
NettyCustomizableResponseTypeHandler
handle
in interface NettyCustomizableResponseTypeHandler<java.lang.Object>
obj
- The object to be handledrequest
- The native Netty requestresponse
- The mutable Micronaut responsecontext
- The channel contextpublic boolean supports(java.lang.Class<?> type)
supports
in interface NettyCustomizableResponseTypeHandler<java.lang.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