public static class DownloadMgrInitialParams.InitCustomMaker extends Object
| Constructor and Description |
|---|
InitCustomMaker() |
public DownloadMgrInitialParams.InitCustomMaker idGenerator(FileDownloadHelper.IdGenerator idGenerator)
idGenerator - the id generator used for generating download identify manually.public DownloadMgrInitialParams.InitCustomMaker connectionCountAdapter(FileDownloadHelper.ConnectionCountAdapter adapter)
adapter - the adapter used for determine how many connection will be used to
downloading the target task.public DownloadMgrInitialParams.InitCustomMaker database(FileDownloadHelper.DatabaseCustomMaker maker)
If you don't customize the data component, we use the result of
DownloadMgrInitialParams.createDefaultDatabase() as the default one.
maker - The database is used for storing the FileDownloadModel.
The data stored in the database is only used for task resumes from the breakpoint.
The task of the data stored in the database must be a task that has not
finished downloading yet, and if the task has finished downloading, its data
will be FileDownloadDatabase.remove(int) from the database, since
that data is no longer available for resumption of its task pass.
public DownloadMgrInitialParams.InitCustomMaker maxNetworkThreadCount(int maxNetworkThreadCount)
If you don't customize the network thread count, we use the result of
DownloadMgrInitialParams.getDefaultMaxNetworkThreadCount() as the default one.
maxNetworkThreadCount - The maximum count of the network thread, what is the number
of simultaneous downloads in FileDownloader.
If this value is less than or equal to 0, the value will be
ignored and use
FileDownloadProperties.downloadMaxNetworkThreadCount
which is defined in filedownloader.properties instead.
public DownloadMgrInitialParams.InitCustomMaker outputStreamCreator(FileDownloadHelper.OutputStreamCreator creator)
If you don't customize the output stream component, we use the result of
DownloadMgrInitialParams.createDefaultOutputStreamCreator() as the default one.
creator - The output stream creator is used for creating
FileDownloadOutputStream which is used to write the input stream
to the file for downloading.public DownloadMgrInitialParams.InitCustomMaker connectionCreator(FileDownloadHelper.ConnectionCreator creator)
If you don't customize the connection component, we use the result of
DownloadMgrInitialParams.createDefaultConnectionCreator() as the default one.
creator - the connection creator will used for create the connection when start
downloading any task in the FileDownloader.public DownloadMgrInitialParams.InitCustomMaker foregroundServiceConfig(ForegroundServiceConfig config)
config - determines how to show an notification for the foreground servicepublic void commit()