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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
ifNotModified
(T value, ServletHttpRequest<?, ? super Object> request, ServletHttpResponse<?, ?> response) Performs if not modified handling.protected void
setDateAndCacheHeaders
(io.micronaut.http.MutableHttpResponse response, long lastModified) protected io.micronaut.http.MutableHttpResponse<?>
setDateHeader
(io.micronaut.http.MutableHttpResponse<?> response) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.servlet.http.ServletResponseEncoder
encode, getResponseType
-
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 responselastModified
- The last modified
-
ifNotModified
protected boolean ifNotModified(@NonNull T value, ServletHttpRequest<?, ? super Object> request, ServletHttpResponse<?, ?> response) Performs if not modified handling.- Parameters:
value
- The valuerequest
- The requestresponse
- The response- Returns:
- True if a not modified response should be returned
-