Class StreamingHttpFile<T extends Closeable>

java.lang.Object
com.linecorp.armeria.server.file.AbstractHttpFile
com.linecorp.armeria.server.file.StreamingHttpFile<T>
Type Parameters:
T - the type of the stream where the file content is read from, e.g. InputStream.
All Implemented Interfaces:
HttpFile

public abstract class StreamingHttpFile<T extends Closeable> extends AbstractHttpFile
A skeletal HttpFile that simplifies the streaming of potentially large content.
  • Constructor Details

    • StreamingHttpFile

      protected StreamingHttpFile(@Nullable @Nullable MediaType contentType, Clock clock, boolean dateEnabled, boolean lastModifiedEnabled, @Nullable @Nullable BiFunction<String,HttpFileAttributes,String> entityTagFunction, HttpHeaders headers)
      Creates a new instance.
      Parameters:
      contentType - the MediaType of the file which will be used as the "content-type" header value. null to disable setting the "content-type" header.
      clock - the Clock which provides the current date and time
      dateEnabled - whether to set the "date" header automatically
      lastModifiedEnabled - whether to add the "last-modified" header automatically
      entityTagFunction - the BiFunction that generates an entity tag from the file's attributes. null to disable setting the "etag" header.
      headers - the additional headers to set
  • Method Details