Class StreamFileEncoder

java.lang.Object
io.micronaut.servlet.http.encoders.AbstractFileEncoder<io.micronaut.http.server.types.files.StreamedFile>
io.micronaut.servlet.http.encoders.StreamFileEncoder
All Implemented Interfaces:
ServletResponseEncoder<io.micronaut.http.server.types.files.StreamedFile>

@Singleton public class StreamFileEncoder extends AbstractFileEncoder<io.micronaut.http.server.types.files.StreamedFile>
A ServletResponseEncoder for StreamedFile.
Since:
1.0.0
Author:
graemerocher
  • Constructor Details

    • StreamFileEncoder

      @Inject public StreamFileEncoder(@Nullable @Nullable ServletConfiguration servletConfiguration)
    • StreamFileEncoder

      public StreamFileEncoder()
  • Method Details

    • getResponseType

      public Class<io.micronaut.http.server.types.files.StreamedFile> getResponseType()
      Returns:
      The response type.
    • encode

      public org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> encode(@NonNull @NonNull ServletExchange<?,?> exchange, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, @NonNull @NonNull io.micronaut.http.server.types.files.StreamedFile value)
      Description copied from interface: ServletResponseEncoder
      Encode the given value.
      Parameters:
      exchange - The change
      annotationMetadata - The annotation metadata declared on the method
      value - The value to encode
      Returns:
      A publisher that emits completes with the response once the value has been encoded