Class PreCompressedResourceSupplier

  • All Implemented Interfaces:
    ResourceSupplier

    public class PreCompressedResourceSupplier
    extends java.lang.Object
    implements ResourceSupplier
    A resource supplier that allows pre-compressed resources to be served if the client accepts the request.

    This is done by checking for the existence of a pre-compressed file, and if it exists and the client supports the encoding then the resource is returned for the pre compressed file

    Author:
    Stuart Douglas
    • Constructor Detail

      • PreCompressedResourceSupplier

        public PreCompressedResourceSupplier​(ResourceManager resourceManager)
    • Method Detail

      • getResource

        public Resource getResource​(HttpServerExchange exchange,
                                    java.lang.String path)
                             throws java.io.IOException
        Specified by:
        getResource in interface ResourceSupplier
        Parameters:
        exchange - The current exchange
        path - The path to resolve
        Returns:
        A resource to serve
        Throws:
        java.io.IOException - if an error ocured resolving the resource