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 Details

    • WithResponse

      public WithResponse(int status, ContentInfo contentInfo, org.springframework.extensions.webscripts.Cache cache)
  • Method Details

    • 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 name
      value - 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 name
      value - 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()
    • getHeaders

      public Map<String,List<String>> getHeaders()