Interface DownloadIndex
-
- All Known Subinterfaces:
WritableDownloadIndex
- All Known Implementing Classes:
DefaultDownloadIndex
@WorkerThread public interface DownloadIndexAn index ofDownloads.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DownloadgetDownload(String id)Returns theDownloadwith the givenid, or null.DownloadCursorgetDownloads(int... states)
-
-
-
Method Detail
-
getDownload
@Nullable Download getDownload(String id) throws IOException
Returns theDownloadwith the givenid, or null.This method may be slow and shouldn't normally be called on the main thread.
- Parameters:
id- ID of aDownload.- Returns:
- The
Downloadwith the givenid, or null if a download state with this id doesn't exist. - Throws:
IOException- If an error occurs reading the state.
-
getDownloads
DownloadCursor getDownloads(@State int... states) throws IOException
Returns aDownloadCursortoDownloads with the givenstates.This method may be slow and shouldn't normally be called on the main thread.
- Parameters:
states- Returns only theDownloads with this states. If empty, returns all.- Returns:
- A cursor to
Downloads with the givenstates. - Throws:
IOException- If an error occurs reading the state.
-
-