download

This function allows for downloading a file from Google Drive.

Return

A Flow of ByteArray representing the file data.

Example usage:

val serviceAccount: JsonNode = // provide your credentials here
val googleDriveApi = GoogleDriveApi(serviceAccount)
val fileDataFlow: Flow<ByteArray> = googleDriveApi.download("0BwwA4oUTeiV1UVNwOHItT0xfa2M")

fileDataFlow.collect { fileData ->
println(fileData.size)
}

Parameters

fileId

The ID of the file to be downloaded.