Class AbstractFileEncoder<T extends io.micronaut.http.server.types.files.FileCustomizableResponseType>

java.lang.Object
io.micronaut.servlet.http.encoders.AbstractFileEncoder<T>
Type Parameters:
T - The type
All Implemented Interfaces:
ServletResponseEncoder<T>
Direct Known Subclasses:
StreamFileEncoder, SystemFileEncoder

public abstract class AbstractFileEncoder<T extends io.micronaut.http.server.types.files.FileCustomizableResponseType> extends Object implements ServletResponseEncoder<T>
Abstract file encoder implementation.
Since:
1.0.0
Author:
graemerocher
  • Constructor Details

    • AbstractFileEncoder

      public AbstractFileEncoder()
  • Method Details

    • setDateHeader

      protected io.micronaut.http.MutableHttpResponse<?> setDateHeader(io.micronaut.http.MutableHttpResponse<?> response)
      Parameters:
      response - The Http response
      Returns:
      The response
    • setDateAndCacheHeaders

      protected void setDateAndCacheHeaders(io.micronaut.http.MutableHttpResponse response, long lastModified)
      Parameters:
      response - The Http response
      lastModified - The last modified
    • ifNotModified

      protected boolean ifNotModified(@NonNull T value, ServletHttpRequest<?,? super Object> request, ServletHttpResponse<?,?> response)
      Performs if not modified handling.
      Parameters:
      value - The value
      request - The request
      response - The response
      Returns:
      True if a not modified response should be returned