Package com.google.android.exoplayer2.testutil

## Class WebServerDispatcher.Resource.Builder

- java.lang.Object
- - com.google.android.exoplayer2.testutil.WebServerDispatcher.Resource.Builder

- Enclosing class:
    WebServerDispatcher.Resource

      public static class WebServerDispatcher.Resource.Builder
      extends Object

  Builder for `WebServerDispatcher.Resource`.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Builder()` | Constructs an instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `WebServerDispatcher.Resource` | `build()` | Builds the `WebServerDispatcher.Resource`.
    `WebServerDispatcher.Resource.Builder` | `resolvesToUnknownLength​(boolean resolvesToUnknownLength)` | Sets if the server shouldn't include the resource length in header responses.
    `WebServerDispatcher.Resource.Builder` | `setData​(byte[] data)` | Sets the data served by this resource.
    `WebServerDispatcher.Resource.Builder` | `setGzipSupport​(int gzipSupport)` | Sets the level of gzip support for this resource.
    `WebServerDispatcher.Resource.Builder` | `setPath​(String path)` | Sets the path this data should be served at.
    `WebServerDispatcher.Resource.Builder` | `supportsRangeRequests​(boolean supportsRangeRequests)` | Sets if RFC 7233 range requests should be supported for this resource.

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

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

- - ### Constructor Detail

    - #### Builder

          public Builder()

      Constructs an instance.

  - ### Method Detail

    - #### setPath

          public WebServerDispatcher.Resource.Builder setPath​(String path)

      Sets the path this data should be served at. This is required.
      Returns:
        this builder, for convenience.

    - #### setData

          public WebServerDispatcher.Resource.Builder setData​(byte[] data)

      Sets the data served by this resource. This is required.
      Returns:
        this builder, for convenience.

    - #### supportsRangeRequests

          public WebServerDispatcher.Resource.Builder supportsRangeRequests​(boolean supportsRangeRequests)

      Sets if RFC 7233 range requests should be supported for this resource. Defaults to false.
      Returns:
        this builder, for convenience.

    - #### resolvesToUnknownLength

          public WebServerDispatcher.Resource.Builder resolvesToUnknownLength​(boolean resolvesToUnknownLength)

      Sets if the server shouldn't include the resource length in header responses.

      If true, responses to unbound requests won't include a Content-Length header and Content-Range headers won't include the total resource length.

      Returns:
        this builder, for convenience.

    - #### setGzipSupport

          public WebServerDispatcher.Resource.Builder setGzipSupport​(@GzipSupport
                                                                     int gzipSupport)

      Sets the level of gzip support for this resource. Defaults to `WebServerDispatcher.Resource.GZIP_SUPPORT_DISABLED`.
      Returns:
        this builder, for convenience.

    - #### build

          public WebServerDispatcher.Resource build()

      Builds the `WebServerDispatcher.Resource`.