Class PreCompressedResourceSupplier
- java.lang.Object
-
- io.undertow.server.handlers.resource.PreCompressedResourceSupplier
-
- All Implemented Interfaces:
ResourceSupplier
public class PreCompressedResourceSupplier extends 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 Summary
Constructors Constructor Description PreCompressedResourceSupplier(ResourceManager resourceManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PreCompressedResourceSupplier
addEncoding(String encoding, String extension)
Resource
getResource(HttpServerExchange exchange, String path)
PreCompressedResourceSupplier
removeEncoding(String encoding)
-
-
-
Constructor Detail
-
PreCompressedResourceSupplier
public PreCompressedResourceSupplier(ResourceManager resourceManager)
-
-
Method Detail
-
getResource
public Resource getResource(HttpServerExchange exchange, String path) throws IOException
- Specified by:
getResource
in interfaceResourceSupplier
- Parameters:
exchange
- The current exchangepath
- The path to resolve- Returns:
- A resource to serve
- Throws:
IOException
- if an error ocured resolving the resource
-
addEncoding
public PreCompressedResourceSupplier addEncoding(String encoding, String extension)
-
removeEncoding
public PreCompressedResourceSupplier removeEncoding(String encoding)
-
-