Top Description Fields Constructors Methods
io.undertow.server.handlers.resource

public Class PreCompressedResourceSupplier

extends Object
implements ResourceSupplier
Class Inheritance
All Implemented Interfaces
io.undertow.server.handlers.resource.ResourceSupplier
Imports
java.io.File, .IOException, java.net.URL, java.nio.file.Path, java.util.Date, .List, .Map, io.undertow.io.IoCallback, .Sender, io.undertow.server.HttpServerExchange, io.undertow.util.CopyOnWriteMap, .ETag, .Headers, .MimeMappings, .QValueParser

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

Field Summary

Modifier and TypeField and Description
private final Map<String, String>
private final ResourceManager

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public PreCompressedResourceSupplier
addEncoding(String encoding, String extension)

private Resource
public Resource
getResource(HttpServerExchange
The current exchange
exchange
,
String
The path to resolve
path
)

Implements io.undertow.server.handlers.resource.ResourceSupplier.getResource.

public PreCompressedResourceSupplier
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

encodingMapback to summary
private final Map<String, String> encodingMap
resourceManagerback to summary
private final ResourceManager resourceManager

Constructor Detail

PreCompressedResourceSupplierback to summary
public PreCompressedResourceSupplier(ResourceManager resourceManager)

Method Detail

addEncodingback to summary
public PreCompressedResourceSupplier addEncoding(String encoding, String extension)
getEncodedResourceback to summary
private Resource getEncodedResource(final HttpServerExchange exchange, String path) throws IOException
getResourceback to summary
public Resource getResource(HttpServerExchange exchange, String path) throws IOException

Implements io.undertow.server.handlers.resource.ResourceSupplier.getResource.

Parameters
exchange:HttpServerExchange

Doc from io.undertow.server.handlers.resource.ResourceSupplier.getResource.

The current exchange

path:String

Doc from io.undertow.server.handlers.resource.ResourceSupplier.getResource.

The path to resolve

Returns:Resource

Doc from io.undertow.server.handlers.resource.ResourceSupplier.getResource.

A resource to serve

Annotations
@Override
Exceptions
IOException:

Doc from io.undertow.server.handlers.resource.ResourceSupplier.getResource.

if an error ocured resolving the resource

removeEncodingback to summary
public PreCompressedResourceSupplier removeEncoding(String encoding)