org.apache.tapestry5.services
Interface ResourceDigestGenerator

All Known Implementing Classes:
ResourceDigestGeneratorImpl

@UsesConfiguration(value=java.lang.String.class)
public interface ResourceDigestGenerator

Responsible for determining which classpath resources require checksums, and for generating checksums for such resources.

The service's configuration identifies which file extensions will be secured using an checksum. The default list is "class" and "tml".

See Also:
ClasspathResource, ClasspathAssetFactory

Method Summary
 String generateDigest(URL url)
          Reads the content of a URL (presumably, for a resource on the classpath) and generates a digest of its content.
 boolean requiresDigest(String path)
          Examines the path (typically, the file name extension at the end of the path) to determine if a checksum is required for the path.
 

Method Detail

requiresDigest

boolean requiresDigest(String path)
Examines the path (typically, the file name extension at the end of the path) to determine if a checksum is required for the path. The path is Resource style, without a leading slash.


generateDigest

String generateDigest(URL url)
Reads the content of a URL (presumably, for a resource on the classpath) and generates a digest of its content. This digest will be incorporated into the URL provided to the client, to verify that the client has been "granted" access to this resource. This is only used for resources where requiresDigest(String) is true.

Parameters:
url -
Returns:
the digest for the resource


Copyright © 2003-2012 The Apache Software Foundation.