Nested Class Summary
Nested Classes Modifier and Type Class Description
ActionFileUpgradeUtil.DownloadIdProviderProvides download IDs during action file upgrade.
All Methods Static Methods Concrete Methods Modifier and Type Method Description
upgradeAndDelete(File actionFilePath, ActionFileUpgradeUtil.DownloadIdProvider downloadIdProvider, DefaultDownloadIndex downloadIndex, boolean deleteOnFailure, boolean addNewDownloadsAsCompleted)
@WorkerThread public static void upgradeAndDelete(File actionFilePath, @Nullable ActionFileUpgradeUtil.DownloadIdProvider downloadIdProvider, DefaultDownloadIndex downloadIndex, boolean deleteOnFailure, boolean addNewDownloadsAsCompleted) throws IOExceptionMerges
DownloadRequestscontained in a legacy action file into a
DefaultDownloadIndex, deleting the action file if the merge is successful or if
This method may be slow and shouldn't normally be called on the main thread.
actionFilePath- The action file path.
downloadIdProvider- A download ID provider, or
nullthen ID of each download will be its custom cache key if one is specified, or else its URL.
downloadIndex- The index into which the requests will be merged.
deleteOnFailure- Whether to delete the action file if the merge fails.
addNewDownloadsAsCompleted- Whether to add new downloads as completed.
IOException- If an error occurs loading or merging the requests.