Class NettySystemFileCustomizableResponseType
java.lang.Object
io.micronaut.http.server.types.files.SystemFile
io.micronaut.http.server.netty.types.files.NettySystemFileCustomizableResponseType
- All Implemented Interfaces:
NettyCustomizableResponseType
,NettyFileCustomizableResponseType
,CustomizableResponseType
,FileCustomizableResponseType
@Internal
public class NettySystemFileCustomizableResponseType
extends SystemFile
implements NettyFileCustomizableResponseType
Writes a
File
to the Netty context.- Since:
- 1.0
- Author:
- James Kleeh, Graeme Rocher
-
Field Summary
Modifier and TypeFieldDescriptionprotected Optional<FileCustomizableResponseType>
static final Supplier<io.netty.util.AttributeKey<SmartHttpContentCompressor>>
Fields inherited from interface io.micronaut.http.server.types.files.FileCustomizableResponseType
ATTACHMENT_HEADER
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionlong
void
process
(MutableHttpResponse response) Modify the response before it is written to the client.io.netty.channel.ChannelFuture
write
(HttpRequest<?> request, MutableHttpResponse<?> response, io.netty.channel.ChannelHandlerContext context) Write this instance to Netty.Methods inherited from class io.micronaut.http.server.types.files.SystemFile
attach, attach, getFile, getLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.http.server.types.files.FileCustomizableResponseType
getLength
-
Field Details
-
ZERO_COPY_PREDICATE
public static final Supplier<io.netty.util.AttributeKey<SmartHttpContentCompressor>> ZERO_COPY_PREDICATE -
delegate
-
-
Constructor Details
-
NettySystemFileCustomizableResponseType
- Parameters:
file
- The file
-
NettySystemFileCustomizableResponseType
- Parameters:
delegate
- The system file customizable response type
-
-
Method Details
-
getLastModified
public long getLastModified()- Specified by:
getLastModified
in interfaceFileCustomizableResponseType
- Overrides:
getLastModified
in classSystemFile
- Returns:
- The last modified date of the file
-
getMediaType
- Specified by:
getMediaType
in interfaceFileCustomizableResponseType
- Overrides:
getMediaType
in classSystemFile
- Returns:
- The media type of the file
-
process
Description copied from interface:CustomizableResponseType
Modify the response before it is written to the client.- Specified by:
process
in interfaceCustomizableResponseType
- Overrides:
process
in classSystemFile
- Parameters:
response
- The response to modify
-
write
public io.netty.channel.ChannelFuture write(HttpRequest<?> request, MutableHttpResponse<?> response, io.netty.channel.ChannelHandlerContext context) Description copied from interface:NettyCustomizableResponseType
Write this instance to Netty.- Specified by:
write
in interfaceNettyCustomizableResponseType
- Parameters:
request
- The requestresponse
- The responsecontext
- The NettyChannelHandlerContext
- Returns:
- The netty future that completes when the response is fully written.
-