download method

Future<String> download(
  1. File gFile
)

Return content of gFile in String

Implementation

Future<String> download(gd.File gFile) async {
  String debugPrefix = '$runtimeType.download()';
  lazy.log(debugPrefix);

  var media = await get(
    gFile.id!,
    downloadOptions: gd.DownloadOptions.fullMedia,
  );
  if (media is gd.Media) {
    String content = await utf8.decodeStream(media.stream);
    lazy.log('$debugPrefix:size:${content.length} byte');
    return content;
  } else {
    throw ('$debugPrefix:File is not Google DriveApi Media.');
  }
}