Class CharSequenceResource

    • Constructor Detail

      • CharSequenceResource

        public CharSequenceResource​(java.lang.String contentType,
                                    java.lang.CharSequence data)
        Creates a Resource from the given char sequence with its content type
        Parameters:
        contentType - The Content type of the array.
        data - The data
      • CharSequenceResource

        public CharSequenceResource​(java.lang.String contentType,
                                    java.lang.CharSequence data,
                                    java.lang.String filename)
        Creates a Resource from the given char sequence with its content type
        Parameters:
        contentType - The Content type of the array.
        data - The data
        filename - The filename that will be set as the Content-Disposition header.
    • Method Detail

      • writeData

        protected void writeData​(org.apache.wicket.request.Response response,
                                 java.lang.CharSequence data)
        Description copied from class: BaseDataResource
        Writes the given data to the response
        Specified by:
        writeData in class BaseDataResource<java.lang.CharSequence>
        Parameters:
        response - The response to write to
        data - The data to write
      • getLength

        protected java.lang.Long getLength​(java.lang.CharSequence data)
        Specified by:
        getLength in class BaseDataResource<java.lang.CharSequence>
        Parameters:
        data - The data to be written
        Returns:
        The length of the data to be written. Used to set "Content-Length" response header
      • getCharset

        protected java.nio.charset.Charset getCharset()
        Returns:
        Charset for resource
      • setCharset

        public void setCharset​(java.nio.charset.Charset charset)
        Sets the character set used for reading this resource.
        Parameters:
        charset - Charset for component