# WebServerDispatcher.Resource

Artifact: [androidx.media3:media3-test-utils](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/test/utils/WebServerDispatcher.java+class:androidx.media3.test.utils.WebServerDispatcher.Resource)

*** ** * ** ***


```
class WebServerDispatcher.Resource
```

<br />

*** ** * ** ***

A resource served by `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher`.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource`. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#GZIP_SUPPORT_DISABLED() = 1` The server doesn't support gzip. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#GZIP_SUPPORT_ENABLED() = 2` The server supports gzip. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#GZIP_SUPPORT_FORCED() = 3` The server supports gzip. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource.Builder!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#buildUpon()()` Returns a new `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource.Builder` initialized with the values from this instance. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#includesContentLengthInRangeResponses()()` Returns true if RFC 7233 HTTP 206 responses should include a `Content-Length` header. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#resolvesToUnknownLength()()` Returns true if the resource should resolve to an unknown length. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#supportsRangeRequests()()` Returns true if RFC 7233 range requests should be supported for this resource. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#data()` |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableListMultimap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#extraResponseHeaders()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#gzipSupport()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSpec.HttpMethod https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#httpMethod()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#nonRangeResponseCode()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#path()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#requestBody()` |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableListMultimap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource#requestHeaders()` |

## Constants

### GZIP_SUPPORT_DISABLED

```
const val GZIP_SUPPORT_DISABLED = 1: Int
```

The server doesn't support gzip.

### GZIP_SUPPORT_ENABLED

```
const val GZIP_SUPPORT_ENABLED = 2: Int
```

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

### GZIP_SUPPORT_FORCED

```
const val GZIP_SUPPORT_FORCED = 3: Int
```

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.

## Public functions

### buildUpon

```
fun buildUpon(): WebServerDispatcher.Resource.Builder!
```

Returns a new `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/WebServerDispatcher.Resource.Builder` initialized with the values from this instance.

### includesContentLengthInRangeResponses

```
fun includesContentLengthInRangeResponses(): Boolean
```

Returns true if RFC 7233 HTTP 206 responses should include a `Content-Length` header.

### resolvesToUnknownLength

```
fun resolvesToUnknownLength(): Boolean
```

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

### supportsRangeRequests

```
fun supportsRangeRequests(): Boolean
```

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

## Public properties

### data

```
val data: Array<Byte>!
```

### extraResponseHeaders

```
val extraResponseHeaders: ImmutableListMultimap<String!, String!>!
```

### gzipSupport

```
val gzipSupport: Int
```

### httpMethod

```
@DataSpec.HttpMethod
val httpMethod: Int
```

### nonRangeResponseCode

```
val nonRangeResponseCode: Int
```

### path

```
val path: String!
```

### requestBody

```
val requestBody: Array<Byte>!
```

### requestHeaders

```
val requestHeaders: ImmutableListMultimap<String!, String!>!
```