Class ContentEscape

  • All Implemented Interfaces:
    Serializable

    public class ContentEscape
    extends ActionEscape
    An Escape subclass that bypasses the usual request -> paint flow by directly producing the binary document content.
    Since:
    1.0.0
    Author:
    Martin Shevchenko
    See Also:
    Serialized Form
    • Constructor Detail

      • ContentEscape

        public ContentEscape​(ContentAccess contentAccess)
        Creates a ContentEscape.
        Parameters:
        contentAccess - the ContentAccess which will provide the content.
    • Method Detail

      • escape

        public void escape()
                    throws IOException
        Writes the content to the response.
        Overrides:
        escape in class Escape
        Throws:
        IOException - if there is an error writing the content.
      • isCacheable

        public boolean isCacheable()
        Returns:
        true if content can be cached.
      • setCacheable

        public void setCacheable​(boolean cacheable)
        Parameters:
        cacheable - set true if the content can be cached.
      • isDisplayInline

        public boolean isDisplayInline()
        Indicates whether the content should be displayed inline or downloaded.
        Returns:
        true if the content should be displayed inline, false if it should be downloaded.
      • setDisplayInline

        public void setDisplayInline​(boolean displayInline)
        Sets whether the content should be displayed inline or downloaded.
        Parameters:
        displayInline - true if the content should be displayed inline, false if it should be downloaded.