Class FileBodyWriter
java.lang.Object
io.micronaut.http.server.netty.body.FileBodyWriter
- All Implemented Interfaces:
MessageBodyWriter<File>
,NettyBodyWriter<File>
@Internal
@Singleton
public final class FileBodyWriter
extends Object
implements NettyBodyWriter<File>
Body writer for
File
s.- Since:
- 4.0.0
- Author:
- Graeme Rocher
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
writeTo
(Argument<File> type, MediaType mediaType, File object, MutableHeaders outgoingHeaders, OutputStream outputStream) Writes an object to the given output stream.void
writeTo
(HttpRequest<?> request, MutableHttpResponse<File> outgoingResponse, Argument<File> type, MediaType mediaType, File object, NettyWriteContext nettyContext) Write an object to the given context.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.body.MessageBodyWriter
createSpecific, isBlocking, isWriteable, writeTo
-
Constructor Details
-
FileBodyWriter
-
-
Method Details
-
writeTo
public void writeTo(HttpRequest<?> request, MutableHttpResponse<File> outgoingResponse, Argument<File> type, MediaType mediaType, File object, NettyWriteContext nettyContext) throws CodecException Description copied from interface:NettyBodyWriter
Write an object to the given context.- Specified by:
writeTo
in interfaceNettyBodyWriter<File>
- Parameters:
request
- The associated requestoutgoingResponse
- The outgoing response.type
- The typemediaType
- The media typeobject
- The object to writenettyContext
- The netty context- Throws:
CodecException
- If an error occurs decoding
-
writeTo
public void writeTo(Argument<File> type, MediaType mediaType, File object, MutableHeaders outgoingHeaders, OutputStream outputStream) throws CodecException Description copied from interface:MessageBodyWriter
Writes an object to the given output stream.- Specified by:
writeTo
in interfaceMessageBodyWriter<File>
- Parameters:
type
- The typemediaType
- The media typeobject
- The object to writeoutgoingHeaders
- The HTTP headersoutputStream
- The output stream- Throws:
CodecException
- If an error occurs decoding
-