spring-framework / org.springframework.web.reactive.function / BodyInserters / fromResource

fromResource

open static fun <T : Resource> fromResource(resource: T): BodyInserter<T, ReactiveHttpOutputMessage>

Return a BodyInserter that writes the given Resource.

If the resource can be resolved to a file, it will be copied using zero-copy.

Parameters

resource - the resource to write to the output message

- the type of the Resource

Return
a BodyInserter that writes a Publisher