ResolvingDataSource.Resolver


interface ResolvingDataSource.Resolver


Resolves DataSpecs.

Summary

Public functions

DataSpec!

Resolves a DataSpec before forwarding it to the wrapped DataSource.

Uri!

Resolves a URI reported by getUri for event reporting and caching purposes.

Public functions

resolveDataSpec

fun resolveDataSpec(dataSpec: DataSpec!): DataSpec!

Resolves a DataSpec before forwarding it to the wrapped DataSource. This method is allowed to block until the DataSpec has been resolved.

Note that this method is called for every new connection, so caching of results is recommended, especially if network operations are involved.

Parameters
dataSpec: DataSpec!

The original DataSpec.

Returns
DataSpec!

The resolved DataSpec.

Throws
java.io.IOException

If an IOException occurred while resolving the DataSpec.

resolveReportedUri

fun resolveReportedUri(uri: Uri!): Uri!

Resolves a URI reported by getUri for event reporting and caching purposes.

Implementations do not need to overwrite this method unless they want to change the reported URI.

This method is not allowed to block.

Parameters
uri: Uri!

The URI as reported by getUri.

Returns
Uri!

The resolved URI used for event reporting and caching.