Back to Exoplayer

WebServerDispatcher (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/testutil/WebServerDispatcher.html

latest3.0 KB
Original Source

Package com.google.android.exoplayer2.testutil

Class WebServerDispatcher

  • java.lang.Object

    • okhttp3.mockwebserver.Dispatcher
      • com.google.android.exoplayer2.testutil.WebServerDispatcher

public classWebServerDispatcherextends 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](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")getRequestPath​(okhttp3.mockwebserver.RecordedRequest request)

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

- 

forResources

public static[WebServerDispatcher](WebServerDispatcher.html "class in com.google.android.exoplayer2.testutil")forResources​([Iterable](https://developer.android.com/reference/java/lang/Iterable.html "class or interface in java.lang")<[WebServerDispatcher.Resource](WebServerDispatcher.Resource.html "class in com.google.android.exoplayer2.testutil")> 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