Interface TypeAwareOutputSupplier

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TypeAwareOutputSupplier
Supplies an OutputStream after receiving the content type for the data that will be streamed to it.
  • Method Summary

    Modifier and Type
    Method
    Description
    getStream(String contentType)
    Returns an OutputStream, given the supplied content type.
  • Method Details

    • getStream

      @Nonnull OutputStream getStream(@Nonnull String contentType) throws IOException
      Returns an OutputStream, given the supplied content type. This gives the implementation a chance to act on the content type, perhaps setting HTTP headers or preparing to validate the streamed data.
      Parameters:
      contentType - the content type for the data that will be written to the stream
      Returns:
      a stream the caller can write content to
      Throws:
      IOException - if a stream cannot be provided