org.apache.tapestry5.services.assets
Interface ResourceMinimizer

All Known Implementing Classes:
AbstractMinimizer, CSSResourceMinimizer, JavaScriptResourceMinimizer, MasterResourceMinimizer

@UsesMappedConfiguration(value=ResourceMinimizer.class)
public interface ResourceMinimizer

Certain kinds of resources can be minimized: this primarily refers to JavaScript and CSS, both of which contain whitespace, comments and other features that can be reduced.

The service configuration maps a MIME content type (e.g., "text/javascript") to an appropriate implementation of this interface. The master service has the @Primary marker interface.

Since:
5.3

Method Summary
 StreamableResource minimize(StreamableResource resource)
          Checks the content type of the resource and applies an appropriate minimization to it if possible.
 

Method Detail

minimize

StreamableResource minimize(StreamableResource resource)
                            throws IOException
Checks the content type of the resource and applies an appropriate minimization to it if possible.

Parameters:
resource - to minimize
Returns:
the same resource, or a minimized replacement for the resource
Throws:
IOException


Copyright © 2003-2012 The Apache Software Foundation.