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