Class StreamingHttpFile<T extends Closeable>

  • 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 Detail

      • StreamingHttpFile

        protected StreamingHttpFile​(@Nullable
                                    MediaType contentType,
                                    Clock clock,
                                    boolean dateEnabled,
                                    boolean lastModifiedEnabled,
                                    @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