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

Unified Diff: utils/pub/io.dart

Issue 10666042: Reverting 9094 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | « utils/pub/entrypoint.dart ('k') | utils/pub/pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index 3e128eac5b8be6de8f3e5eaa1a589744a905f25b..3f3c9d0a37f469ac7f25a3b1e6261cc5ce9fdc75 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -8,7 +8,6 @@
#library('io');
#import('dart:io');
-#import('dart:uri');
/** Gets the current working directory. */
String get workingDir() => new File('.').fullPathSync();
@@ -264,51 +263,6 @@ Future<File> createSymlink(from, to) {
String getFullPath(entry) => new File(_getPath(entry)).fullPathSync();
/**
- * Opens an input stream for a HTTP GET request to [uri], which may be a
- * [String] or [Uri].
- */
-InputStream httpGet(uri) {
- var resultStream = new ListInputStream();
- var connection = new HttpClient().getUrl(_getUri(uri));
-
- // TODO(nweiz): propagate this error to the return value. See issue 3657.
- connection.onError = (e) { throw e; };
- connection.onResponse = (response) {
- if (response.statusCode >= 400) {
- // TODO(nweiz): propagate this error to the return value. See issue 3657.
- throw new Exception(
- "HTTP request for $uri failed with status ${response.statusCode}");
- }
-
- pipeInputToInput(response.inputStream, resultStream);
- };
-
- return resultStream;
-}
-
-/**
- * Takes all input from [source] and writes it to [sink].
- */
-void pipeInputToInput(InputStream source, ListInputStream sink) {
- source.onClosed = sink.markEndOfStream;
- source.onData = () => sink.write(source.read());
- // TODO(nweiz): propagate this error to the sink. See issue 3657.
- source.onError = (e) { throw e; };
-}
-
-/**
- * Buffers all input from an InputStream and returns it as a future.
- */
-Future<List<int>> consumeInputStream(InputStream stream) {
- var completer = new Completer<List<int>>();
- var buffer = <int>[];
- stream.onClosed = () => completer.complete(buffer);
- stream.onData = () => buffer.addAll(stream.read());
- stream.onError = (e) => completer.completeException(e);
- return completer.future;
-}
-
-/**
* Spawns and runs the process located at [executable], passing in [args].
* Returns a [Future] that will complete the results of the process after it
* has ended.
@@ -403,24 +357,6 @@ Future<bool> get isGitInstalled() {
}
/**
- * Extracts a `.tar.gz` file from [stream] to [destination], which can be a
- * directory or a path. Returns whether or not the extraction was successful.
- */
-Future<bool> extractTarGz(InputStream stream, destination) {
- var process = Process.start("tar",
- ["--extract", "--gunzip", "--directory", _getPath(destination)]);
- var completer = new Completer<int>();
-
- stream.pipe(process.stdin);
- process.stdout.pipe(stdout, close: false);
- process.stderr.pipe(stderr, close: false);
-
- process.onExit = completer.complete;
- process.onError = completer.completeException;
- return completer.future.transform((exitCode) => exitCode == 0);
-}
-
-/**
* Contains the results of invoking a [Process] and waiting for it to complete.
*/
class PubProcessResult {
@@ -453,11 +389,3 @@ Directory _getDirectory(entry) {
if (entry is Directory) return entry;
return new Directory(entry);
}
-
-/**
- * Gets a [Uri] for [uri], which can either already be one, or be a [String].
- */
-Uri _getUri(uri) {
- if (uri is Uri) return uri;
- return new Uri.fromString(uri);
-}
« no previous file with comments | « utils/pub/entrypoint.dart ('k') | utils/pub/pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698