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

Unified Diff: sdk/lib/io/link.dart

Issue 57943002: Add fromUri constructor to File, Directory and Link (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review commetns Created 7 years, 1 month 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 | « sdk/lib/io/file.dart ('k') | tests/standalone/io/directory_uri_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/link.dart
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart
index 82aef2a5450b9f971921fd6e8a3e909fbf2c921c..7f07234ab54dc3f343009605ddbc721bc8de56f9 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -15,6 +15,13 @@ abstract class Link implements FileSystemEntity {
factory Link(String path) => new _Link(path);
/**
+ * Create a Lint object from a URI.
+ *
+ * If [uri] cannot reference a link this throws [UnsupportedError].
+ */
+ factory Link.fromUri(Uri uri) => new Link(uri.toFilePath());
+
+ /**
* Creates a symbolic link. Returns a [:Future<Link>:] that completes with
* the link when it has been created. If the link exists,
* the future will complete with an error.
@@ -143,7 +150,6 @@ class _Link extends FileSystemEntity implements Link {
}
}
-
String toString() => "Link: '$path'";
Future<bool> exists() => FileSystemEntity.isLink(path);
« no previous file with comments | « sdk/lib/io/file.dart ('k') | tests/standalone/io/directory_uri_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698