Class WithResponse
- java.lang.Object
-
- org.alfresco.rest.framework.webscripts.WithResponse
-
public class WithResponse extends Object
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
Constructors Constructor Description WithResponse(int status, ContentInfo contentInfo, org.springframework.extensions.webscripts.Cache cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHeader(String name, String value)
Adds a response header with the given name and value.org.springframework.extensions.webscripts.Cache
getCache()
ContentInfo
getContentInfo()
Map<String,List<String>>
getHeaders()
int
getStatus()
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
setHeader(String name, String value)
Set a response header with the given name and value.void
setStatus(int status)
Sets the Response Status
-
-
-
Constructor Detail
-
WithResponse
public WithResponse(int status, ContentInfo contentInfo, org.springframework.extensions.webscripts.Cache cache)
-
-
Method Detail
-
setContentInfo
public void setContentInfo(ContentInfo contentInfo)
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
public void setHeader(String name, String value)
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
public void addHeader(String name, String value)
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
public ContentInfo getContentInfo()
-
getStatus
public int getStatus()
-
getCache
public org.springframework.extensions.webscripts.Cache getCache()
-
-