Package com.google.android.exoplayer2.testutil

## Class WebServerDispatcher

- java.lang.Object
- - okhttp3.mockwebserver.Dispatcher
  - - com.google.android.exoplayer2.testutil.WebServerDispatcher

-     public class WebServerDispatcher
      extends okhttp3.mockwebserver.Dispatcher

  A `Dispatcher` for `MockWebServer` that allows per-path customisation of the static data served.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `WebServerDispatcher.Resource` | A resource served by `WebServerDispatcher`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `okhttp3.mockwebserver.MockResponse` | `dispatch​(okhttp3.mockwebserver.RecordedRequest request)` |
    `static WebServerDispatcher` | `forResources​(Iterable<WebServerDispatcher.Resource> resources)` | Constructs a dispatcher that handles requests based the provided `WebServerDispatcher.Resource` instances.
    `static String` | `getRequestPath​(okhttp3.mockwebserver.RecordedRequest request)` | Returns the path for a given `RecordedRequest`, stripping any query parameters.

    - ### Methods inherited from class okhttp3.mockwebserver.Dispatcher

      `peek, shutdown`

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

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

- - ### Method Detail

    - #### getRequestPath

          public static String getRequestPath​(okhttp3.mockwebserver.RecordedRequest request)

      Returns the path for a given `RecordedRequest`, stripping any query parameters.

    - #### forResources

          public static WebServerDispatcher forResources​(Iterable<WebServerDispatcher.Resource> resources)

      Constructs a dispatcher that handles requests based the provided `WebServerDispatcher.Resource` instances.

    - #### dispatch

          public okhttp3.mockwebserver.MockResponse dispatch​(okhttp3.mockwebserver.RecordedRequest request)

      Specified by:
        `dispatch` in class `okhttp3.mockwebserver.Dispatcher`