class DefaultDownloadIndex implements WritableDownloadIndex {

  @Override
  @Nullable
  public Download getDownload(String id) throws DatabaseIOException {
    ensureInitialized();
    try (Cursor cursor = getCursor(WHERE_ID_EQUALS, new String[] {id})) {
      if (cursor.getCount() == 0) {
        return null;
      }
      cursor.moveToNext();
      return getDownloadForCurrentRow(cursor);
    } catch (SQLiteException e) {
      throw new DatabaseIOException(e);
    }
  }

  public  DefaultDownloadIndex(DatabaseProvider databaseProvider);
  public  DefaultDownloadIndex(DatabaseProvider databaseProvider, String name);

}