Index: sdk/lib/io/file.dart |
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart |
index 1c0e37142e8899b19ff2a8a1bcb70a2425a76044..db7c924f1963de86bba1919fb81208b240c1af5f 100644 |
--- a/sdk/lib/io/file.dart |
+++ b/sdk/lib/io/file.dart |
@@ -41,6 +41,13 @@ abstract class File implements FileSystemEntity { |
factory File(String path) => new _File(path); |
/** |
+ * Create a File object from a URI. |
+ * |
+ * If [uri] cannot reference a file this throws [UnsupportedError]. |
+ */ |
+ factory File.fromUri(Uri uri) => new File(uri.toFilePath()); |
+ |
+ /** |
* Create the file. Returns a [:Future<File>:] that completes with |
* the file when it has been created. |
* |