org.apache.tapestry5.services

## Interface AssetFactory

- All Known Implementing Classes:
    AbstractAssetFactory, ClasspathAssetFactory, ContextAssetFactory, ExternalUrlAssetFactory

      public interface AssetFactory

  Used by `AssetSource` to create new `Asset`s as needed.

  Starting in Tapestry 5.4, the built-in implementations of this interface (for context assets, and for classpath assets) were changed so that when underlying resources changed, the client URLs for Assets are discarded; this is necessitated by two factors:

  1) the client URL for an Asset now includes a checksum based on the content of the underlying resource, so a change to resource content (during development) results in a change to the URL.

  2) `JavaScriptStack` (especially the `ExtensibleJavaScriptStack` implementation) made no provision for rebuilding the Assets post-construction, and there is no backwards compatible way to introduce this concept (and JavaScriptStacks are something many applications and third-party libraries make use of).

  So, starting in Tapestry 5.4, the implementations of `Asset` should be
  See Also:
    `AssetSource`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Asset` | `createAsset(Resource resource)` Creates an instance of an asset.
    `Resource` | `getRootResource()` Returns the Resource representing the root folder of the domain this factory is responsible for.

- - ### Method Detail

    - #### getRootResource

          Resource getRootResource()

      Returns the Resource representing the root folder of the domain this factory is responsible for.

    - #### createAsset

          Asset createAsset(Resource resource)

      Creates an instance of an asset. Starting with 5.1.0.0, it is preferred (but not required) that the factory return an instance of `Asset2`.
      Parameters:
        `resource` - a resource within this factories domain (derived from the root resource)
      Returns:
        an Asset for the resource

${project.version} - Copyright © 2003-2014 The Apache Software Foundation.