mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Add simpler DownloadManager constructor
PiperOrigin-RevId: 245397736
This commit is contained in:
parent
e4f1f89f5c
commit
0128cebce1
1 changed files with 18 additions and 0 deletions
|
|
@ -193,6 +193,24 @@ public final class DownloadManager {
|
||||||
new DefaultDownloaderFactory(new DownloaderConstructorHelper(cache, upstreamFactory)));
|
new DefaultDownloaderFactory(new DownloaderConstructorHelper(cache, upstreamFactory)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a {@link DownloadManager}.
|
||||||
|
*
|
||||||
|
* @param context Any context.
|
||||||
|
* @param databaseProvider Provides the SQLite database in which downloads are persisted.
|
||||||
|
* @param cache A cache to be used to store downloaded data. The cache should be configured with
|
||||||
|
* an {@link CacheEvictor} that will not evict downloaded content, for example {@link
|
||||||
|
* NoOpCacheEvictor}.
|
||||||
|
* @param upstreamFactory A {@link Factory} for creating {@link DataSource}s for downloading data.
|
||||||
|
*/
|
||||||
|
public DownloadManager(
|
||||||
|
Context context, DatabaseProvider databaseProvider, Cache cache, Factory upstreamFactory) {
|
||||||
|
this(
|
||||||
|
context,
|
||||||
|
new DefaultDownloadIndex(databaseProvider),
|
||||||
|
new DefaultDownloaderFactory(new DownloaderConstructorHelper(cache, upstreamFactory)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a {@link DownloadManager}.
|
* Constructs a {@link DownloadManager}.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue