Package org.appng.api.support
Interface HttpHeaderUtils.HttpResource
-
- Enclosing class:
- HttpHeaderUtils
public static interface HttpHeaderUtils.HttpResource
A resource that has been requested by anHttpServletRequest
and eventually needs to be updated.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getContentType()
Returns the content-type for this resourcebyte[]
getData()
Retrieves the data of this resource.default org.springframework.http.HttpHeaders
getHeaders()
Returns theHttpHeaders
for this resource.default org.springframework.http.HttpStatus
getStatus()
Returns theHttpStatus
for this resource.boolean
needsUpdate()
Whether or not this resource has been updated duringupdate()
.default void
setStatus(org.springframework.http.HttpStatus status)
Set the status for this response.long
update()
Updates this resource if necessary and returns the latest version.
-
-
-
Method Detail
-
update
long update() throws IOException
Updates this resource if necessary and returns the latest version.- Returns:
- the latest version of the resource
- Throws:
IOException
- if an error occurs while updating
-
getContentType
String getContentType()
Returns the content-type for this resource- Returns:
- the content-type
-
needsUpdate
boolean needsUpdate()
Whether or not this resource has been updated duringupdate()
.- Returns:
true
if this resource has been updated- See Also:
update()
-
getData
byte[] getData() throws IOException
Retrieves the data of this resource.- Returns:
- the data
- Throws:
IOException
- if an error occurs while retrieving the data
-
setStatus
default void setStatus(org.springframework.http.HttpStatus status)
Set the status for this response.- Parameters:
status
- the status
-
getStatus
default org.springframework.http.HttpStatus getStatus()
Returns theHttpStatus
for this resource. Default:HttpStatus#OK
.- Returns:
- the status
-
getHeaders
default org.springframework.http.HttpHeaders getHeaders()
Returns theHttpHeaders
for this resource. Default: An emptyHttpHeaders
object- Returns:
- the HttpHeaders
-
-