public class

WebServerDispatcher.Resource.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.media3.test.utils.WebServerDispatcher.Resource.Builder

Overview

Builder for WebServerDispatcher.Resource.

Summary

Constructors
publicBuilder()

Constructs an instance.

Methods
public WebServerDispatcher.Resourcebuild()

Builds the WebServerDispatcher.Resource.

public WebServerDispatcher.Resource.BuilderresolvesToUnknownLength(boolean resolvesToUnknownLength)

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

public WebServerDispatcher.Resource.BuildersetData(byte[] data[])

Sets the data served by this resource.

public WebServerDispatcher.Resource.BuildersetGzipSupport(int gzipSupport)

Sets the level of gzip support for this resource.

public WebServerDispatcher.Resource.BuildersetPath(java.lang.String path)

Sets the path this data should be served at.

public WebServerDispatcher.Resource.BuildersupportsRangeRequests(boolean supportsRangeRequests)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Constructs an instance.

Methods

public WebServerDispatcher.Resource.Builder setPath(java.lang.String path)

Sets the path this data should be served at. This is required.

Returns:

this builder, for convenience.

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

Sets the data served by this resource. This is required.

Returns:

this builder, for convenience.

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.

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.

public WebServerDispatcher.Resource.Builder setGzipSupport(int gzipSupport)

Sets the level of gzip support for this resource. Defaults to WebServerDispatcher.Resource.GZIP_SUPPORT_DISABLED.

Returns:

this builder, for convenience.

Builds the WebServerDispatcher.Resource.