Class FileEncoder

java.lang.Object
io.micronaut.servlet.http.encoders.FileEncoder
All Implemented Interfaces:
ServletResponseEncoder<File>

@Singleton public class FileEncoder extends Object implements ServletResponseEncoder<File>
Handles File.
Since:
1.0.0
Author:
graemerocher
  • Constructor Details

    • FileEncoder

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

      public FileEncoder()
  • Method Details

    • getResponseType

      public Class<File> getResponseType()
      Specified by:
      getResponseType in interface ServletResponseEncoder<File>
      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 File value)
      Description copied from interface: ServletResponseEncoder
      Encode the given value.
      Specified by:
      encode in interface ServletResponseEncoder<File>
      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