HttpDataSource.BaseFactory
@UnstableApi
public abstract class HttpDataSource.BaseFactory implements HttpDataSource.Factory
Base implementation of Factory that sets default request properties.
Summary
Public constructors |
|---|
Public methods |
|
|---|---|
final HttpDataSource |
Creates a |
final HttpDataSource.Factory |
@CanIgnoreReturnValueSets the default request headers for |
Protected methods |
|
|---|---|
abstract HttpDataSource |
createDataSourceInternal(Called by createDataSource to create a |
Inherited methods |
||
|---|---|---|
|
Public constructors
Public methods
setDefaultRequestProperties
@CanIgnoreReturnValue
public final HttpDataSource.Factory setDefaultRequestProperties(
Map<String, String> defaultRequestProperties
)
Sets the default request headers for HttpDataSource instances created by the factory.
The new request properties will be used for future requests made by HttpDataSources created by the factory, including instances that have already been created. Modifying the defaultRequestProperties map after a call to this method will have no effect, and so it's necessary to call this method again each time the request properties need to be updated.
| Returns | |
|---|---|
HttpDataSource.Factory |
This factory. |
Protected methods
createDataSourceInternal
protected abstract HttpDataSource createDataSourceInternal(
HttpDataSource.RequestProperties defaultRequestProperties
)
Called by createDataSource to create a HttpDataSource instance.
| Parameters | |
|---|---|
HttpDataSource.RequestProperties defaultRequestProperties |
The default |
| Returns | |
|---|---|
HttpDataSource |
A |