Class WithResponse
java.lang.Object
org.alfresco.rest.framework.webscripts.WithResponse
Values to be set on the response at the appropriate time.
It should be ok to set these variables multiple times but only the latest values are used.
- Author:
- Gethin James
-
Constructor Summary
ConstructorsConstructorDescriptionWithResponse
(int status, ContentInfo contentInfo, org.springframework.extensions.webscripts.Cache cache) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a response header with the given name and value.org.springframework.extensions.webscripts.Cache
getCache()
int
void
setCache
(org.springframework.extensions.webscripts.Cache cache) Sets the Cache controlvoid
setContentInfo
(ContentInfo contentInfo) Sets the information about the content: mimetype, encoding, locale, lengthvoid
Set a response header with the given name and value.void
setStatus
(int status) Sets the Response Status
-
Constructor Details
-
WithResponse
public WithResponse(int status, ContentInfo contentInfo, org.springframework.extensions.webscripts.Cache cache)
-
-
Method Details
-
setContentInfo
Sets the information about the content: mimetype, encoding, locale, length- Parameters:
contentInfo
-
-
setStatus
public void setStatus(int status) Sets the Response Status- Parameters:
status
- int
-
setHeader
Set a response header with the given name and value. If the header has already been set, the new value overwrites the previous one.- Parameters:
name
- header namevalue
- header value
-
addHeader
Adds a response header with the given name and value. This method allows a response header to have multiple values.- Parameters:
name
- header namevalue
- header value
-
setCache
public void setCache(org.springframework.extensions.webscripts.Cache cache) Sets the Cache control- Parameters:
cache
- cache control
-
getContentInfo
-
getStatus
public int getStatus() -
getCache
public org.springframework.extensions.webscripts.Cache getCache() -
getHeaders
-