Class AbstractHttpFile

java.lang.Object
com.linecorp.armeria.server.file.AbstractHttpFile
All Implemented Interfaces:
HttpFile
Direct Known Subclasses:
StreamingHttpFile

public abstract class AbstractHttpFile
extends Object
implements HttpFile
A skeletal HttpFile implementation.
  • Constructor Details

    • AbstractHttpFile

      protected AbstractHttpFile​(@Nullable MediaType contentType, Clock clock, boolean dateEnabled, boolean lastModifiedEnabled, @Nullable BiFunction<String,​HttpFileAttributes,​String> entityTagFunction, HttpHeaders additionalHeaders)
      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.
      additionalHeaders - the additional headers to set
  • Method Details