Index: sdk/lib/io/link.dart |
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart |
index 82aef2a5450b9f971921fd6e8a3e909fbf2c921c..68920a60e402c6ea0706b9ffc03715e7eac5874f 100644 |
--- a/sdk/lib/io/link.dart |
+++ b/sdk/lib/io/link.dart |
@@ -15,6 +15,12 @@ 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.fromUri(uri); |
+ /** |
* 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,6 +149,7 @@ class _Link extends FileSystemEntity implements Link { |
} |
} |
+ factory _Link.fromUri(Uri uri) => new _Link(uri.toFilePath()); |
String toString() => "Link: '$path'"; |