Class AbstractResourceStreamWriter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes the resource.
      java.lang.String getContentType()
      Gets the mime type of this resource
      java.io.InputStream getInputStream()
      this method should not be used as it is not required for resource writers
      java.util.Locale getLocale()  
      java.lang.String getStyle()  
      java.lang.String getVariation()  
      Time lastModifiedTime()
      Just returns now.
      Bytes length()
      Default implementation to returns null, i.e.
      void setLocale​(java.util.Locale locale)
      This method shouldn't be used from the outside.
      void setStyle​(java.lang.String style)
      This method shouldn't be used from the outside.
      void setVariation​(java.lang.String variation)
      This method shouldn't be used from the outside.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractResourceStreamWriter

        public AbstractResourceStreamWriter()
    • Method Detail

      • length

        public Bytes length()
        Default implementation to returns null, i.e. chunked-encoding will be used. Do override this if you know the length up front.
        Specified by:
        length in interface IResourceStream
        Returns:
        The size of this resource in the number of bytes, or null if unknown
      • getLocale

        public java.util.Locale getLocale()
        Specified by:
        getLocale in interface IResourceStream
        Returns:
        The Locale where this stream did resolve to
      • setLocale

        public void setLocale​(java.util.Locale locale)
        Description copied from interface: IResourceStream
        This method shouldn't be used from the outside. It is used by the Loaders to set the resolved locale.
        Specified by:
        setLocale in interface IResourceStream
        Parameters:
        locale - The Locale where this stream did resolve to.
      • lastModifiedTime

        public Time lastModifiedTime()
        Just returns now.
        Specified by:
        lastModifiedTime in interface IModifiable
        Returns:
        the last modification Time or null if that information is not available
      • getInputStream

        public final java.io.InputStream getInputStream()
        this method should not be used as it is not required for resource writers
        Specified by:
        getInputStream in interface IResourceStream
        Returns:
        Returns the inputStream.
        See Also:
        IResourceStream.close()
      • close

        public void close()
                   throws java.io.IOException
        Closes the resource. Normally, this includes closing any underlying input stream returned by getInputStream().

        This implementation does nothing.

        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface IResourceStream
        Throws:
        java.io.IOException - if an error occurred.
      • getContentType

        public java.lang.String getContentType()
        Description copied from interface: IResourceStream
        Gets the mime type of this resource
        Specified by:
        getContentType in interface IResourceStream
        Returns:
        The mime type of this resource, such as "image/jpeg" or "text/html". Return null to let ResourceStreamRequestHandler handle the Content-Type automatically
      • getStyle

        public java.lang.String getStyle()
        Specified by:
        getStyle in interface IResourceStream
        Returns:
        The Style where this stream did resolve to
      • setStyle

        public void setStyle​(java.lang.String style)
        Description copied from interface: IResourceStream
        This method shouldn't be used from the outside. It is used by the Loaders to set the resolved Style.
        Specified by:
        setStyle in interface IResourceStream
        Parameters:
        style - The style where this stream did resolve to.
      • getVariation

        public java.lang.String getVariation()
        Specified by:
        getVariation in interface IResourceStream
        Returns:
        The Variation where this stream did resolve to
      • setVariation

        public void setVariation​(java.lang.String variation)
        Description copied from interface: IResourceStream
        This method shouldn't be used from the outside. It is used by the Loaders to set the resolved variation.
        Specified by:
        setVariation in interface IResourceStream
        Parameters:
        variation - The Variation where this stream did resolve to.