Class PartEventHttpMessageWriter

All Implemented Interfaces:
HttpMessageWriter<PartEvent>

public class PartEventHttpMessageWriter extends MultipartWriterSupport implements HttpMessageWriter<PartEvent>
HttpMessageWriter for writing PartEvent objects. Useful for server-side proxies, that relay multipart requests to others services.
Since:
6.0
Author:
Arjen Poutsma
See Also:
  • Constructor Details

    • PartEventHttpMessageWriter

      public PartEventHttpMessageWriter()
  • Method Details

    • canWrite

      public boolean canWrite(org.springframework.core.ResolvableType elementType, @Nullable MediaType mediaType)
      Description copied from interface: HttpMessageWriter
      Whether the given object type is supported by this writer.
      Specified by:
      canWrite in interface HttpMessageWriter<PartEvent>
      Parameters:
      elementType - the type of object to check
      mediaType - the media type for the write (possibly null)
      Returns:
      true if writable, false otherwise
    • write

      public reactor.core.publisher.Mono<Void> write(Publisher<? extends PartEvent> partDataStream, org.springframework.core.ResolvableType elementType, @Nullable MediaType mediaType, ReactiveHttpOutputMessage outputMessage, Map<String,Object> hints)
      Description copied from interface: HttpMessageWriter
      Write a given stream of object to the output message.
      Specified by:
      write in interface HttpMessageWriter<PartEvent>
      Parameters:
      partDataStream - the objects to write
      elementType - the type of objects in the stream which must have been previously checked via HttpMessageWriter.canWrite(ResolvableType, MediaType)
      mediaType - the content type for the write (possibly null to indicate that the default content type of the writer must be used)
      outputMessage - the message to write to
      hints - additional information about how to encode and write
      Returns:
      indicates completion or error