Package com.google.android.exoplayer2.testutil

## Class WebServerDispatcher.Resource

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

- Enclosing class:
    WebServerDispatcher

      public static class WebServerDispatcher.Resource
      extends Object

  A resource served by `WebServerDispatcher`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `WebServerDispatcher.Resource.Builder` | Builder for `WebServerDispatcher.Resource`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `GZIP_SUPPORT_DISABLED` | The server doesn't support gzip.
    `static int` | `GZIP_SUPPORT_ENABLED` | The server supports gzip.
    `static int` | `GZIP_SUPPORT_FORCED` | The server supports gzip.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `WebServerDispatcher.Resource.Builder` | `buildUpon()` | Returns a new `WebServerDispatcher.Resource.Builder` initialized with the values from this instance.
    `byte[]` | `getData()` | Returns the data served by this resource.
    `@com.google.android.exoplayer2.testutil.WebServerDispatcher.Resource.GzipSupport int` | `getGzipSupport()` | Returns the level of gzip support the server should provide for this resource.
    `String` | `getPath()` | Returns the path this resource is available at.
    `boolean` | `resolvesToUnknownLength()` | Returns true if the resource should resolve to an unknown length.
    `boolean` | `supportsRangeRequests()` | Returns true 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`

- - ### Field Detail

    - #### GZIP_SUPPORT_DISABLED

          public static final int GZIP_SUPPORT_DISABLED

      The server doesn't support gzip.
      See Also:
        Constant Field Values

    - #### GZIP_SUPPORT_ENABLED

          public static final int GZIP_SUPPORT_ENABLED

      The server supports gzip. Responses are only compressed if the request signals "gzip" is an acceptable content-coding using an `Accept-Encoding` header.
      See Also:
        Constant Field Values

    - #### GZIP_SUPPORT_FORCED

          public static final int GZIP_SUPPORT_FORCED

      The server supports gzip. Responses are compressed if the request contains no `Accept-Encoding` header or one that accepts `"gzip"`.

      RFC 2616 14.3 recommends a server use `"identity"` content-coding if no `Accept-Encoding` is present, but some servers will still compress responses in this case. This option mimics that behaviour.

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getPath

          public String getPath()

      Returns the path this resource is available at.

    - #### getData

          public byte[] getData()

      Returns the data served by this resource.

    - #### supportsRangeRequests

          public boolean supportsRangeRequests()

      Returns true if RFC 7233 range requests should be supported for this resource.

    - #### resolvesToUnknownLength

          public boolean resolvesToUnknownLength()

      Returns true if the resource should resolve to an unknown length.

    - #### getGzipSupport

          public @com.google.android.exoplayer2.testutil.WebServerDispatcher.Resource.GzipSupport int getGzipSupport()

      Returns the level of gzip support the server should provide for this resource.

    - #### buildUpon

          public WebServerDispatcher.Resource.Builder buildUpon()

      Returns a new `WebServerDispatcher.Resource.Builder` initialized with the values from this instance.