| Index: tools/dartium/download_file.dart
|
| diff --git a/tools/dartium/download_file.dart b/tools/dartium/download_file.dart
|
| index 6339ae88ade94d5788cb6585d0f0a896573c0c4c..972141217e5bc568c35dde8cff4b52d2a442aa71 100644
|
| --- a/tools/dartium/download_file.dart
|
| +++ b/tools/dartium/download_file.dart
|
| @@ -7,16 +7,17 @@ import 'dart:io';
|
|
|
| Future downloadFile(Uri url, String destination) {
|
| var client = new HttpClient();
|
| - return client.getUrl(url)
|
| - .then((HttpClientRequest request) => request.close())
|
| - .then((HttpClientResponse response) {
|
| - if (response.statusCode != HttpStatus.OK) {
|
| - throw new Exception("Http status code (${response.statusCode}) "
|
| - "was not 200. Aborting.");
|
| - }
|
| - var sink = new File(destination).openWrite();
|
| - return response.pipe(sink).then((_) {
|
| - client.close();
|
| + return client
|
| + .getUrl(url)
|
| + .then((HttpClientRequest request) => request.close())
|
| + .then((HttpClientResponse response) {
|
| + if (response.statusCode != HttpStatus.OK) {
|
| + throw new Exception("Http status code (${response.statusCode}) "
|
| + "was not 200. Aborting.");
|
| + }
|
| + var sink = new File(destination).openWrite();
|
| + return response.pipe(sink).then((_) {
|
| + client.close();
|
| });
|
| });
|
| }
|
|
|