Interface AssetFactory

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

    public interface AssetFactory
    Used by AssetSource to create new Assets 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 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.
        Parameters:
        resource - a resource within this factories domain (derived from the root resource)
        Returns:
        an Asset for the resource