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

Unified Diff: sdk/lib/io/directory.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 | « no previous file | sdk/lib/io/file.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/directory.dart
diff --git a/sdk/lib/io/directory.dart b/sdk/lib/io/directory.dart
index 8f54a3928f142b13f8cb6c3026bf886f46542413..fee6dc9871bf9e5a624e0574cfa5e9160abe084b 100644
--- a/sdk/lib/io/directory.dart
+++ b/sdk/lib/io/directory.dart
@@ -16,6 +16,13 @@ abstract class Directory implements FileSystemEntity {
factory Directory(String path) => new _Directory(path);
/**
+ * Create a Directory object from a URI.
+ *
+ * If [uri] cannot reference a directory this throws [UnsupportedError].
+ */
+ factory Directory.fromUri(Uri uri) => new Directory(uri.toFilePath());
+
+ /**
* Creates a directory object pointing to the current working
* directory.
*/
« no previous file with comments | « no previous file | sdk/lib/io/file.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698