Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: tools/dartium/download_file.dart

Issue 2976303002: Remove Dartium for TIP of origin/master (Closed)
Patch Set: Updated Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dartium/dartium_bot_utils.py ('k') | tools/dartium/download_shellscript_template.bat » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dartium/download_file.dart
diff --git a/tools/dartium/download_file.dart b/tools/dartium/download_file.dart
deleted file mode 100644
index 972141217e5bc568c35dde8cff4b52d2a442aa71..0000000000000000000000000000000000000000
--- a/tools/dartium/download_file.dart
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:async';
-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();
- });
- });
-}
-
-void main(List<String> arguments) {
- die(String message) {
- print(message);
- exit(1);
- }
-
- if (arguments.length != 2) {
- var scriptName = Platform.script.pathSegments.last;
- die("Usage dart $scriptName <url> <destination-file>");
- }
-
- var url = Uri.parse(arguments[0]);
- var destination = arguments[1];
-
- if (!['http', 'https'].contains(url.scheme)) {
- die("Unsupported scheme in uri $url");
- }
-
- print("Downloading $url to $destination.");
- downloadFile(url, destination).then((_) {
- print("Download finished.");
- }).catchError((error) {
- die("An unexpected error occured: $error.");
- });
-}
« no previous file with comments | « tools/dartium/dartium_bot_utils.py ('k') | tools/dartium/download_shellscript_template.bat » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698