public final class OkHttpDataSourceFactory extends HttpDataSource.BaseFactory
HttpDataSource.Factory that produces OkHttpDataSource.| Constructor and Description |
|---|
OkHttpDataSourceFactory(okhttp3.Call.Factory callFactory,
String userAgent,
TransferListener<? super DataSource> listener) |
OkHttpDataSourceFactory(okhttp3.Call.Factory callFactory,
String userAgent,
TransferListener<? super DataSource> listener,
okhttp3.CacheControl cacheControl) |
| Modifier and Type | Method and Description |
|---|---|
protected OkHttpDataSource |
createDataSourceInternal(HttpDataSource.RequestProperties defaultRequestProperties)
Called by
HttpDataSource.BaseFactory.createDataSource() to create a HttpDataSource instance. |
clearAllDefaultRequestProperties, clearDefaultRequestProperty, createDataSource, getDefaultRequestProperties, setDefaultRequestPropertypublic OkHttpDataSourceFactory(@NonNull okhttp3.Call.Factory callFactory, @Nullable String userAgent, @Nullable TransferListener<? super DataSource> listener)
callFactory - A Call.Factory (typically an OkHttpClient) for use
by the sources created by the factory.userAgent - An optional User-Agent string.listener - An optional listener.public OkHttpDataSourceFactory(@NonNull okhttp3.Call.Factory callFactory, @Nullable String userAgent, @Nullable TransferListener<? super DataSource> listener, @Nullable okhttp3.CacheControl cacheControl)
callFactory - A Call.Factory (typically an OkHttpClient) for use
by the sources created by the factory.userAgent - An optional User-Agent string.listener - An optional listener.cacheControl - An optional CacheControl for setting the Cache-Control header.protected OkHttpDataSource createDataSourceInternal(HttpDataSource.RequestProperties defaultRequestProperties)
HttpDataSource.BaseFactoryHttpDataSource.BaseFactory.createDataSource() to create a HttpDataSource instance.createDataSourceInternal in class HttpDataSource.BaseFactorydefaultRequestProperties - The default RequestProperties to be used by the
HttpDataSource instance.HttpDataSource instance.