Skip to content

v0.2.0 - API Redesign

Choose a tag to compare

@OneXeor OneXeor released this 13 Jan 22:26
· 7 commits to main since this release
cf6bc7f

Breaking Changes

Complete API redesign with Kotlin DSL. The old API has been replaced.

New Features

  • Kotlin DSL - Fluent builder pattern for configuring downloads
  • Authentication - Bearer token and Basic auth support
  • Custom headers - Add any HTTP headers to requests
  • Network restrictions - WiFi-only download option
  • State management - Typed sealed classes for download states
  • Error handling - Typed error classes (Network, Http, Storage, etc.)
  • Fluent listeners - Chain multiple listeners with fluent API

Usage

val downloader = KDownloader()

downloader.download("https://example.com/file.pdf") {
    fileName = "document.pdf"
    
    auth {
        bearer("token")
    }
    
    onProgress { println("${it.percentage}%") }
    onComplete { println("Done: $it") }
    onError { println("Error: ${it.message}") }
}

Installation

implementation("dev.onexeor.kdownloader:shared:0.2.0")

See README for full documentation.