Class StreamedFile

java.lang.Object
io.micronaut.http.server.types.files.StreamedFile
All Implemented Interfaces:
MediaTypeProvider, CustomizableResponseType, FileCustomizableResponseType

public class StreamedFile extends Object implements FileCustomizableResponseType
A special type for streaming an InputStream representing a file or resource.
Since:
1.0
Author:
James Kleeh
  • Constructor Details

    • StreamedFile

      public StreamedFile(InputStream inputStream, MediaType mediaType)
      Parameters:
      inputStream - The input stream
      mediaType - The media type of the content
    • StreamedFile

      public StreamedFile(InputStream inputStream, MediaType mediaType, long lastModified)
      Parameters:
      inputStream - The input stream
      mediaType - The media type of the content
      lastModified - The last modified date
    • StreamedFile

      public StreamedFile(InputStream inputStream, MediaType mediaType, long lastModified, long contentLength)
      Parameters:
      inputStream - The input stream
      mediaType - The media type of the content
      lastModified - The last modified date
      contentLength - the content length
    • StreamedFile

      public StreamedFile(URL url)
      Immediately opens a connection to the given URL to retrieve data about the connection, including the input stream.
      Parameters:
      url - The URL to resource
  • Method Details