diff --git a/CHANGELOG b/CHANGELOG index cb547ad2..63a89a43 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,8 +4,11 @@ Version 2.1.0-RC5 This option allows Fetch to notify the newly attached listener instantly of the download status of all downloads managed by the namespace. Default is false. - Added new Fetch and RxFetch method getDownloadsByRequestIdentifier(identifier: Long). Use request.identifier field. +- Added new convenience method on FetchConfiguration class called getNewFetchInstanceFromConfiguration which + returns a newly created instance of Fetch. - Updated Kotlin plugin version to 1.2.50 - Updated other library dependencies. +- Bug Fixes Version 2.1.0-RC4 - Added new method enableListenerNotifyOnAttached(enabled) to FetchConfiguration.Builder class. diff --git a/fetch2/src/main/java/com/tonyodev/fetch2/FetchConfiguration.kt b/fetch2/src/main/java/com/tonyodev/fetch2/FetchConfiguration.kt index 308d6205..fa079613 100644 --- a/fetch2/src/main/java/com/tonyodev/fetch2/FetchConfiguration.kt +++ b/fetch2/src/main/java/com/tonyodev/fetch2/FetchConfiguration.kt @@ -23,6 +23,14 @@ class FetchConfiguration private constructor(val appContext: Context, val fileServerDownloader: FileServerDownloader?, val md5CheckingEnabled: Boolean) { + /* Creates a new Instance of Fetch with this object's configuration settings. Convenience method + * for Fetch.Impl.getInstance(fetchConfiguration) + * @return new Fetch instance + * */ + fun getNewFetchInstanceFromConfiguration(): Fetch { + return Fetch.getInstance(this) + } + /** Used to create an instance of Fetch Configuration.*/ class Builder(context: Context) { @@ -240,6 +248,7 @@ class FetchConfiguration private constructor(val appContext: Context, if (autoStart != other.autoStart) return false if (retryOnNetworkGain != other.retryOnNetworkGain) return false if (fileServerDownloader != other.fileServerDownloader) return false + if (md5CheckingEnabled != other.md5CheckingEnabled) return false return true } @@ -256,6 +265,7 @@ class FetchConfiguration private constructor(val appContext: Context, result = 31 * result + autoStart.hashCode() result = 31 * result + retryOnNetworkGain.hashCode() result = 31 * result + (fileServerDownloader?.hashCode() ?: 0) + result = 31 * result + md5CheckingEnabled.hashCode() return result } @@ -264,7 +274,8 @@ class FetchConfiguration private constructor(val appContext: Context, "concurrentLimit=$concurrentLimit, progressReportingIntervalMillis=$progressReportingIntervalMillis," + " downloadBufferSizeBytes=$downloadBufferSizeBytes, loggingEnabled=$loggingEnabled, " + "httpDownloader=$httpDownloader, globalNetworkType=$globalNetworkType, logger=$logger, " + - "autoStart=$autoStart, retryOnNetworkGain=$retryOnNetworkGain, fileServerDownloader=$fileServerDownloader)" + "autoStart=$autoStart, retryOnNetworkGain=$retryOnNetworkGain, " + + "fileServerDownloader=$fileServerDownloader, md5CheckingEnabled=$md5CheckingEnabled)" } } \ No newline at end of file