UploadSource

class UploadSource(val fileName: String, val contentLength: Long, val contentType: String = guessContentType(fileName), val sourceId: String = fileName, val versionTag: String = "", rangeOpener: (Long) -> InputStream? = null, opener: () -> InputStream)

Reopenable media input used by signed uploads.

The SDK intentionally does not depend on android.net.Uri. Keeping the Android framework out of the core artifact makes it JVM-testable, while an app can still stream a content URI with: UploadSource(name, size, mime, uri.toString()) { resolver.openInputStream(uri)!! }.

Constructors

Link copied to clipboard
constructor(fileName: String, contentLength: Long, contentType: String = guessContentType(fileName), sourceId: String = fileName, versionTag: String = "", rangeOpener: (Long) -> InputStream? = null, opener: () -> InputStream)

Types

Link copied to clipboard
object Companion

Factories for common replayable sources.

Properties

Link copied to clipboard

exact source length

Link copied to clipboard

source media type

Link copied to clipboard

transmitted file name

Link copied to clipboard

stable checkpoint identity

Link copied to clipboard

source revision used to reject stale checkpoints

Functions

Link copied to clipboard
fun open(offset: Long = 0, length: Long = contentLength - offset): InputStream

Opens a bounded stream for the requested byte range. The caller owns it.