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

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: 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/directory.dart ('k') | sdk/lib/io/link.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
*
« no previous file with comments | « sdk/lib/io/directory.dart ('k') | sdk/lib/io/link.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698