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 forWebServerDispatcher.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 theWebServerDispatcher.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(@com.google.android.exoplayer2.testutil.WebServerDispatcher.Resource.GzipSupport 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.
-
-
-
Method Detail
-
setPath
@CanIgnoreReturnValue 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
@CanIgnoreReturnValue public WebServerDispatcher.Resource.Builder setData(byte[] data)
Sets the data served by this resource. This is required.- Returns:
- this builder, for convenience.
-
supportsRangeRequests
@CanIgnoreReturnValue 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
@CanIgnoreReturnValue 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
@CanIgnoreReturnValue public WebServerDispatcher.Resource.Builder setGzipSupport(@com.google.android.exoplayer2.testutil.WebServerDispatcher.Resource.GzipSupport int gzipSupport)
Sets the level of gzip support for this resource. Defaults toWebServerDispatcher.Resource.GZIP_SUPPORT_DISABLED
.- Returns:
- this builder, for convenience.
-
build
public WebServerDispatcher.Resource build()
Builds theWebServerDispatcher.Resource
.
-
-