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

Unified Diff: tools/gardening/lib/src/util.dart

Issue 2751543006: structure gardening tool (Closed)
Patch Set: oops Created 3 years, 9 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/gardening/lib/current_summary.dart ('k') | tools/gardening/lib/status_summary.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gardening/lib/src/util.dart
diff --git a/tools/gardening/lib/src/util.dart b/tools/gardening/lib/src/util.dart
index b27614e8a96e9b9b2e4cf526deebb32e02b2f35d..278d4e3c29db43e3ba67ceb562614b2e77a1c319 100644
--- a/tools/gardening/lib/src/util.dart
+++ b/tools/gardening/lib/src/util.dart
@@ -2,6 +2,10 @@
// 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:convert';
+import 'dart:io';
+
/// Split [text] using [infixes] as infix markers.
List<String> split(String text, List<String> infixes) {
List<String> result = <String>[];
@@ -28,3 +32,10 @@ const bool LOG = const bool.fromEnvironment('LOG', defaultValue: false);
void log(String text) {
if (LOG) print(text);
}
+
+/// Reads the content of [uri] as text.
+Future<String> readUriAsText(HttpClient client, Uri uri) async {
+ HttpClientRequest request = await client.getUrl(uri);
+ HttpClientResponse response = await request.close();
+ return await response.transform(UTF8.decoder).join();
+}
« no previous file with comments | « tools/gardening/lib/current_summary.dart ('k') | tools/gardening/lib/status_summary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698