Class ResourceStreamResource

  • All Implemented Interfaces:
    java.io.Serializable, IResource, org.apache.wicket.util.io.IClusterable

    public class ResourceStreamResource
    extends AbstractResource
    A resource that loads its data from IResourceStream
    See Also:
    Serialized Form
    • Constructor Detail

      • ResourceStreamResource

        public ResourceStreamResource()
        Constructor.
      • ResourceStreamResource

        public ResourceStreamResource​(org.apache.wicket.util.resource.IResourceStream stream)
        Constructor.
        Parameters:
        stream - the resource stream to read from
    • Method Detail

      • setFileName

        public ResourceStreamResource setFileName​(java.lang.String fileName)
        Parameters:
        fileName -
        Returns:
        this object, for chaining
      • setTextEncoding

        public ResourceStreamResource setTextEncoding​(java.lang.String textEncoding)
        Parameters:
        textEncoding -
        Returns:
        this object, for chaining
      • getCacheDuration

        public org.apache.wicket.util.time.Duration getCacheDuration()
        Returns:
        the duration for which the resource will be cached by the browser
      • setCacheDuration

        public ResourceStreamResource setCacheDuration​(org.apache.wicket.util.time.Duration cacheDuration)
        Parameters:
        cacheDuration - the duration for which the resource will be cached by the browser
        Returns:
        this object, for chaining
      • getResourceStream

        protected org.apache.wicket.util.resource.IResourceStream getResourceStream​(IResource.Attributes attributes)
        Lazy or dynamic initialization of the wrapped IResourceStream(Writer)
        Parameters:
        attributes - The request attributes
        Returns:
        the underlying IResourceStream. May be null.