org.apache.tapestry5.internal.services

## Class AssetDispatcher

- java.lang.Object
- - org.apache.tapestry5.internal.services.AssetDispatcher

- All Implemented Interfaces:
    Dispatcher

      @UsesMappedConfiguration(value=AssetRequestHandler.class)
       @Marker(value=AssetRequestDispatcher.class)
      public class AssetDispatcher
      extends Object
      implements Dispatcher

  Recognizes requests where the path begins with "/asset/" (actually, as defined by the `SymbolConstants.ASSET_PATH_PREFIX` symbol), and delivers the content therein as a bytestream. Also handles requests that are simply polling for a change to the file (including checking the ETag in the request against the asset's checksum.
  See Also:
    `ResourceStreamer`, `ClasspathAssetAliasManager`, `AssetRequestHandler`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AssetDispatcher(Map<String,AssetRequestHandler> configuration, PathConstructor pathConstructor, String assetPathPrefix)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `dispatch(Request request, Response response)` Analyzes the incoming request and performs an appropriate operation for each.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AssetDispatcher

          public AssetDispatcher(Map<String,AssetRequestHandler> configuration,
                                 PathConstructor pathConstructor,
                                 @Symbol(value="tapestry.asset-path-prefix")
                                 String assetPathPrefix)

  - ### Method Detail

    - #### dispatch

          public boolean dispatch(Request request,
                                  Response response)
                           throws IOException

      Description copied from interface: `Dispatcher`
      Analyzes the incoming request and performs an appropriate operation for each.
      Specified by:
        `dispatch` in interface `Dispatcher`
      Returns:
        true if a response was delivered, false if the dispatcher did not handle the request (and a search for a handler should continue)
      Throws:
        `IOException`

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