Class ResourceStreamerImpl

    • Method Detail

      • streamResource

        public boolean streamResource​(Resource resource,
                                      java.lang.String providedChecksum,
                                      java.util.Set<ResourceStreamer.Options> options)
                               throws java.io.IOException
        Description copied from interface: ResourceStreamer
        Streams the content of the resource to the client (or sends an alternative response such as HttpServletResponse.SC_NOT_MODIFIED). Encapsulates logic for compression and for caching.
        Specified by:
        streamResource in interface ResourceStreamer
        Parameters:
        resource - to stream
        providedChecksum - checksum from URL (or null/blank to not validate against checksum, which is normal for modules)
        options - enable or disable certain features
        Throws:
        java.io.IOException
        See Also:
        StreamableResourceSource
      • streamResource

        public boolean streamResource​(StreamableResource streamable,
                                      java.lang.String providedChecksum,
                                      java.util.Set<ResourceStreamer.Options> options)
                               throws java.io.IOException
        Description copied from interface: ResourceStreamer
        Streams a resource that has been assembled elsewhere. The StreamableResource may reflect either a normal or a compressed stream, depending on the type of resource and the capabilities of the client.
        Specified by:
        streamResource in interface ResourceStreamer
        Parameters:
        streamable - content to stream
        providedChecksum - checksum provided (in the URL) to validate against the StreamableResource.getChecksum() actual checksum} for the resource, may be null/blank to not validate against the checksum
        options - enable or disable certain features
        Returns:
        true if the request was handled (even if sending a HttpServletResponse.SC_NOT_MODIFIED response), or false if the request was not handled (because the provided checksum did not match the actual checksum).
        Throws:
        java.io.IOException