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

Unified Diff: sdk/lib/io/file.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: Added tests 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
Index: sdk/lib/io/file.dart
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index 1c0e37142e8899b19ff2a8a1bcb70a2425a76044..add73a8f7fbcbe24c92d166c2734017532c96d3a 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.fromUri(uri);
+
+ /**
* Create the file. Returns a [:Future<File>:] that completes with
* the file when it has been created.
*

Powered by Google App Engine
This is Rietveld 408576698