@WorkerThread
@UnstableApi
interface DownloadIndex

Known direct subclasses
WritableDownloadIndex

A writable index of Downloads.

Known indirect subclasses
DefaultDownloadIndex

A DownloadIndex that uses SQLite to persist Downloads.


An index of Downloads.

Summary

Public functions

Download?

Returns the Download with the given id, or null.

DownloadCursor!

Returns a DownloadCursor to Downloads with the given states.

Public functions

getDownload

fun getDownload(id: String!): Download?

Returns the Download with the given id, or null.

This method may be slow and shouldn't normally be called on the main thread.

Parameters
id: String!

ID of a Download.

Returns
Download?

The Download with the given id, or null if a download state with this id doesn't exist.

Throws
java.io.IOException

If an error occurs reading the state.

getDownloads

fun getDownloads(@Download.State states: IntArray!): DownloadCursor!

Returns a DownloadCursor to Downloads with the given states.

This method may be slow and shouldn't normally be called on the main thread.

Parameters
@Download.State states: IntArray!

Returns only the Downloads with this states. If empty, returns all.

Returns
DownloadCursor!

A cursor to Downloads with the given states.

Throws
java.io.IOException

If an error occurs reading the state.